Wrong coordinates on the exported XFDF

I’m using the pdfTron library in an Angular app
When I create annotation on top left of the webViewer I get the X and Y of this annotation with X=0, Y=0.
which is correct for me.
But the issue in the exported XFDF, I get wrong rect values, like it start from the bottom left or something like that.
in the output of the exported XFDF I want the rect values has the same X and Y values
Is there a way to set the coordinates that should be used in the exported XFDF ?
I think the default coordinates exported in the XFDF are of the PDF
But in my case I want the coordinates of the webViewer to be exported in th XFDF

The PDF coordinate system, which is what XFDF uses, starts in the bottom left corner of the page. This means the y-axis is in the opposite direction to many graphic technologies where y-axis goes down.

But in my case I want the coordinates of the webViewer to be exported in th XFDF

Could you elaborate on why exactly this is important for you?
What do you do with the coordinates afterwards, if they were the way you wanted?

1 Like

This is important for me, because, we are not using the same coordinate system between our app and the HMI (human-machine interface) which results in issues related to annotations position.
So if we can use the viewer coordinate system in the exported XFDF this will be great for us.

Since XFDF is standard XML, you can edit the XFDF using your favorite XML tool.

The result though would no longer be valid XFDF, so I would not recommend this.

I would suggest doing the translation between coordinate systems when you read/import the XFDF into your HMI system. The PDF coordinate system is fully defined in the PDF specification which you can find online, from that information you can determine how to translate to your HMI coordinate system.