Export annotation and flipping of y values. What do you mean by flipping the y values?

PDF.js Express Version

Detailed description of issue
Hi Logan , Just wanted to confirm if we are doing any scaling in sending y coordinates in pdfjs express. My use case is as follows- I am sending my annotations through a post api from where it will be converted into an image using OCR(mainly using for annotating tables). But the coordinates that are received in the backend do not crop the table efficiently . Is there a scaling that needs to be performed for that? We are mainly having issue with the y coordinates.

Expected behaviour
Bound info contains the xml file with the coordinates.

Link to document
{Provide a link to the document in question if possible}

Code snippet
annotManager.on(‘annotationChanged’, (annotations, action, { imported }) => {
// If
if (imported) return;
annotManager.exportAnnotCommand().then(xfdfString => {
var formData = new FormData()
formData.append(‘bound_info’, xfdfString)
const headers = new HttpHeaders({ ‘Content-Type’: ‘application/json’ });
headers.append(‘Accept’, ‘application/json’);
fetch(http://3.131.98.86:8000/submittal/upload_file/, {
method: ‘PATCH’,
body: formData,
});

    });

  })

Hi!

The values in the annotations are in PDF Coordinates which means they start at the bottom left.

You can find more info about it here.

To translate the Y coord to the top left, you can do const topLeftY = pageHeight - y

I hope this helps!
Thanks,
Logan