我正在尝试使用Apache Formatting Object Processor对输出的PDF文件进行注释/注释。找不到任何东西。
我尝试的是突出显示文本,并在其下方写上注释。但这会完全扭曲呈现的PDF的外观。
在XML中,我有类似的东西。
def countMinReversals(expr):
lenn = len(expr)
# length of expression must be even
# to make it balanced by using reversals.
if (lenn % 2) :
return -1
# After this loop, stack contains
# unbalanced part of expression,
# i.e., expression of the form "...."
s = []
for i in range(lenn):
if (expr[i] =='' and len(s)):
if (s[0] == '') :
s.pop(0)
else:
s.insert(0, expr[i])
else:
s.insert(0, expr[i])
# Length of the reduced expression
# red_len = (m+n)
red_len = len(s)
# count opening brackets at the
# end of stack
n = 0
while (len(s)and s[0] == '') :
s.pop(0)
n += 1
# return ceil(m/2) + ceil(n/2) which
# is actually equal to (m+n)/2 + n%2
# when m+n is even.
return (red_len // 2 + n % 2)
我想要的是与文本关联的注释,因为其他PDF编辑器(如Adobe Acrobat或Foxit)的注释功能可以实现。
Apache FOP和XSLT可以吗?