ParseForm

Parser.ParseForm method

解析文档格式。

public DocumentData ParseForm()

返回值

的实例DocumentData包含提取数据的类; 无效的如果不支持按模板解析。

评论

了解更多:

例子

以下示例显示了如何解析文档的一种形式:

// 创建解析器类的实例
using (Parser parser = new Parser(filePath))
{
    // 从PDF文档中提取数据
    DocumentData data = parser.ParseForm();
    // 遍历提取的数据
    for (int i = 0; i<data.Count; i++)
    {
        Console.Write(data[i].Name + ": ");
        PageTextArea area = data[i].PageArea as PageTextArea;
        Console.WriteLine(area == null ? "Not a template field" : area.Text);
    }
}

也可以看看