Free Support Forum - groupdocs.com

How to get position for PDF template in .NET

Hi, I am trying to use the GroupDocs.Parser for extracting data from the PDF using template, my question is how to get the coordinates positions. Is there any tool or something you are using to get those position and put into the template.
Like in this example
TemplateField templateField = new TemplateField(
new TemplateFixedPosition(new Rectangle(new Point(35, 160), new Size(110, 20))),
“Address”);

From where i can get 35,160 or 110,20. Any tool you are using to get those position.
Plz help me with that.
Thanks

1 Like

@paramvir

No, we are not using any tool to get coordinates. You have to provides a template field position which is defined by the rectangular area yourself. Rectangle gets the rectangular area that contains the template field. Please have a look at this documentation article. You could also use TemplateRegexPosition, it provides a template field position which uses the regular expression.

TemplateField templateField = new TemplateField(
    new TemplateRegexPosition("Invoice Number\\s+[A-Z0-9\\-]+"), 
    "InvoiceNumber");