【发布时间】:2020-04-24 21:46:35
【问题描述】:
我按照此答案中的示例从 PDF 文档中获取可编辑字段值:
How to extract PDF fields from a filled out form in Python?
对于每个字段,我得到一个如下所示的数据结构。但该列表包括所有页面中的所有字段。如何确定每个字段所在的页面?在调试器中,我尝试查看 PDFObjRef 的“AP”和“P”项目,但这并没有引导我到任何地方。
'AP' = {dict: 1} {'N': <PDFObjRef:1947>}
'DA' = {bytes: 23} b'0 0 0 rg /ArialMT 10 Tf'
'F' = {int} 4
'FT' = {PSLiteral} /'Tx'
'M' = {bytes: 23} b"D:20200129121854-06'00'"
'MK' = {dict: 0} {}
'P' = {PDFObjRef} <PDFObjRef:1887>
'Rect' = {list: 4} [36.3844, 28.5617, 254.605, 55.1097]
'StructParent' = {int} 213
'Subtype' = {PSLiteral} /'Widget'
'T' = {bytes: 12} b'CustomerName'
'TU' = {bytes: 13} b'Customer Name'
'Type' = {PSLiteral} /'Annot'
'V' = {bytes: 21} b'Ball-Mart Stores, Inc.'
TIA
【问题讨论】:
标签: python pdf field pdfminer page-numbering