【问题标题】:How to properly PDF forms programmatically made with Adobe LiveCycle Designer如何正确使用 Adob​​e LiveCycle Designer 以编程方式制作 PDF 表单
【发布时间】:2021-05-22 19:37:35
【问题描述】:

使用 PYPDF2 或 pdfrw 填写的传统 Adob​​e Acrobat 表单无法在 Acrobat 中正确显示——文本在您单击之前是不可见的。当您在 Mac 上使用 Preview 填写这些表单时,也会发生同样的事情。

解决办法是在表单上运行这个函数:

t = pdfrw.PdfReader('a form.pdf')
t.pages[0]['/Annots'][4].update(pdfrw.PdfDict(V='some text that goes into field 4'))
t.Root.AcroForm.update(pdfrw.PdfDict(NeedAppearances=pdfrw.PdfObject("true")))
pdfrw.PdfWriter().write('foo2.pdf',t)

经过大量试验,我确定这种方法不适用于 Adob​​e LiveCycle Designer 创建的表单。事实上,当我尝试使用 Acrobat 打开这些表单时,我收到了这个可爱的错误消息:

所以我的问题是 --- 有什么方法可以正确编辑这些表单吗?

我怀疑问题可能是我的特定表单没有正确设置字体,所以我愿意为字段指定字体。

【问题讨论】:

    标签: python pdf automation


    【解决方案1】:

    听从建议并购买 Livecycle Designer。

    或者使用 Acroforms 而不是 XFA 重新创建表单……

    【讨论】:

      猜你喜欢
      • 2015-08-10
      • 1970-01-01
      • 2019-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多