Annotations moving on downloaded pdf when opened in Abode Acrobat and BLUEBEAM

Hello Logan, thanks for the response!

For more information, here are the steps we are using to process PDF files:

  1. Users add annotations to files on the frontend client.

  2. Our backend receives the PDF file URL and the associated XFDF with the user made annotations.

  3. We use the API - ‘requests.post(url=‘https://api.pdfjs.express/xfdf/merge’,
    data=data, files=files)’ to merge the annotations to the source file.

  4. Once merged, we expect the annotations to be flattened and read only. But that does not happen. The annotations are still clickable and exist in a different layer (/Annots) in the PDF file. If they were properly flattened, they should not exist in a different layer.

  5. Our next step is that we need to resize each page of the PDF file and contract the text to make space for a header and a footer for our users. Doing so, the annotations move around in the resized PDF as they still follow their original coordinates. These original coordinates are now invalid as the PDF contents are shifted after we resize the pages.

  6. To address the above, we go through each /Rect component of each annotation in the /Annots layer of the PDF and adjust the coordinates of annotations to ensure they move to the intended location.

Ideally, we want to flatten the annotations in the PDF such that there should be no need to manually move the coordinates of each annotation ourselves. Is that possible in PDF.js? Do we have to send additional arguments in the merge REST API?

Additionally, once our users download the PDF files, they shouldn’t be able to click on the annotations and edit or delete them. This happens consistently now on Windows Adobe PDF viewers. Could you please advise us on how to combat this?

I’m happy to provide any other information as you need and also can jump on a call to show the issue if you’d like.

Thanks for the support.

Best,
Pratyush