iText在现有pdf上创建只读文本字段

时间:2018-05-09 03:14:09

标签: java itext

这是我的设置,我有一个现有的PDF文件,我想添加字段。我已成功添加字段并设置选项,但如果我在字段中添加In [1]: import ctypes as c In [2]: from ctypes.util import find_library In [3]: name = 'Mdsdcl' In [4]: libname = find_library(name) In [5]: c.CDLL(libname) --------------------------------------------------------------------------- OSError Traceback (most recent call last) <ipython-input-6-7c40f200b197> in <module>() ----> 1 c.CDLL(libname) /usr/lib/python3.6/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error) 346 347 if handle is None: --> 348 self._handle = _dlopen(self._name, mode) 349 else: 350 self._handle = handle OSError: libreadline.so.6: cannot open shared object file: No such file or directory 选项,则会丢失READ_ONLY选项。它保持字体大小,无论我设置的是什么。在设置其他选项之前,我还尝试使用MULTILINE选项。

READ_ONLY

1 个答案:

答案 0 :(得分:3)

因为当您再次呼叫ValueError: Memoryview assignment: Lvalue has a different structure than RValue 时,内部值将被覆盖。

如果要同时使用这两个功能,则必须合并选项并一次保存:

setOptions()