Check if data isn’t null (parse form is supported for the document);
Iterate over field data to obtain form data.
The following example shows how to parse a form of the document:
// Create an instance of Parser classusing(Parserparser=newParser(filePath)){// Extract data from PDF documentDocumentDatadata=parser.ParseForm();// Check if form extraction is supportedif(data==null){Console.WriteLine("Form extraction isn't supported.");return;}// Iterate over extracted datafor(inti=0;i<data.Count;i++){Console.Write(data[i].Name+": ");PageTextAreaarea=data[i].PageAreaasPageTextArea;Console.WriteLine(area==null?"Not a template field":area.Text);}}
More resources
Advanced usage topics
To learn more about document data extraction features and get familiar how to extract text, images, forms and more, please refer to the advanced usage section.
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full featured .NET library we provide simple, but powerful free Apps.
You are welcome to extract text, metadata and images from PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, Emails and more with our free online Free Online Document Parser App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.