0

我正在尝试使用 AbcPdf .net 组件(版本 7)来处理一些 PDF 并生成元数据。我想知道是否有办法列出pdf文档中的所有标签?作为标记 pdf 的示例,我在这里使用此文件

是否有任何其他组件或工具可用于列出或提取 pdf 标签?

提前感谢您的帮助

4

1 回答 1

0

使用 iTextSharp。它是免费的,您只需要“itextsharp.dll”。

http://sourceforge.net/projects/itextsharp/

这是一个从 PDF 中读取文本的简单函数。

Public Shared Function GetTextFromPDF(PdfFileName As String) As String
    Dim oReader As New iTextSharp.text.pdf.PdfReader(PdfFileName)

    Dim sOut = ""

    For i = 1 To oReader.NumberOfPages
        Dim its As New iTextSharp.text.pdf.parser.SimpleTextExtractionStrategy

        sOut &= iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(oReader, i, its)
    Next

    Return sOut
End Function

ITextSharp 也有处理标签的方法。

于 2011-09-01T18:35:04.860 回答