我从客户那里得到了 PDF 文件。该文件长达 60 页。我需要从第 49 页中间到第 58 页读取数据。在 ColdFusion 中,有一个cfpdf
标签可以读取 pdf 文档。这是我到目前为止的示例:
<cftry>
<cfset mypdf = expandPath("./data.pdf")>
<cfpdf action="read" source="#mypdf#" name="PDFInfo">
<cfdump var="#PDFInfo#">
<cfcatch type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
将文档转储到屏幕上后,会显示以下信息:
Author [empty string]
CenterWindowOnScreen no
ChangingDocument Allowed
Commenting Allowed
ContentExtraction Allowed
CopyContent Allowed
PageSizes
PDFDocumentarray
1
PDFDocument - struct
height 792
width 612
2
PDFDocument - struct
height 792
width 612
3
PDFDocument - struct
height 792
width 612
4
PDFDocument - struct
height 792
width 612
我以前从未使用过 cfpdf,这对我来说是新事物。我试图在网上搜索,但找不到有关如何从 PDF 文档中获取数据的示例。有没有一种从文件/文档中特定页面获取数据的好方法?另外我猜必须有一个允许访问单个行数据的循环。如果有人对此问题有很好的资源示例,请告诉我。谢谢。