We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Extract Form Fields Information from PDF document using Aspose.PDF for .NET - X/Y positions are not correct

Extracted the Elements from the PDF and convert to JSON Its seems to be the X, Y positions are not correct. Below I have shared the JSON object I have generated from the PDF. This is the top most element in the PDF but Y value I am getting 641.951, because of this this element rendered bottom of the page. How I can get the exact position of the in put controls ?
{
“FieldName”: “ClientName”,
“FieldValue”: null,
“OptionName”: “”,
“Description”: “Client Name”,
“Order”: 1,
“MaxLength”: 50,
“MultiLine”: false,
“IsFormatted”: false,
“IsChecked”: false,
“Required”: true,
“ReadOnly”: false,
“IsCalculation”: false,
“FieldType”: “TextBoxField”,
“X”: 90.7641,
“Y”: 641.951,
“Width”: 211.3879,
“Height”: 17.668999999999983
}

@sinaj

Thank you for contacting support.

Please note that the origin (0,0) of page is bottom left corner. Likewise, top left corner is (0,H) where H is the height of page. Moreover, basic measuring unit in Aspose.PDF for .NET is point, where 1 inch = 72 points. If you still think the coordinate value is incorrect then please share source file so that we may investigate accordingly. Also ensure using Aspose.PDF for .NET 19.11.

Thanks for the quick response. We will check it out and comeback, if required any further clarifications.

@sinaj

Please feel free to contact us if you need any further assistance.

Hi Farhan ,
Still, i am getting wrong coordinates for each field , When I tried to extract X & Y Coordinates using a different tool I was able to achieve correct position. I am sharing PDF, JSON Extracted from both tools

Attached zip contains both json

Let me know where i went wrong

TravelAuthorizationForm-JSON.zip (4.4 KB)
.
TravelAuthorizationForm.pdf (115.2 KB)

@Mukund.Mudgal,

Can you please share complete sample project or working sample which you are using on your end.

Hi ,

Please find attached code and attached pdf for extracting JSON

TravelAuthorizationForm.pdf (115.2 KB)

Program.zip (1.4 KB)

@Mukund.Mudgal,

Thanks for contacting support.

We have tested this scenario in our environment and have been able to observe the issue that you have mentioned. We have logged issue with ID PDFNET-47494 in our issue tracking system. We will share with you as soon as logged issue is fixed.

Hi I am trying to extract background image of the PDF , but while trying to extract background image i am getting only layout not entire PDF as background image

@Mukund.Mudgal,

Can you please share source file along with sample code and generated result so that we may further investigate to help you out.