Hiding Revision Notes/Comments for Flattened Annotations

WebViewer Version:

Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? Yes
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No
Is your issue related to annotations? Yes

Please give a brief summary of your issue:
Is there a way to remove the “Revision Notes” attached to annotations when flattening them into a PDF from being baked into the resultant pdf? We’d like the annotations to remain but without the extraneous metadata if that makes sense. In this screenshot, the red square shows this “metadata” we’d like to remove from the resultant pdf, while still showing the annotations (red squiggly lines and text).

Please describe your issue and provide steps to reproduce it:
Load a document in the webviewer and make a few annotations. Flatten the annotations into the doc and save the new pdf. Load the new pdf in the web viewer.

Here is the code we are using for flattening:

  const { annotationManager, documentViewer } = instance.Core;
  // 2. export: annotations string from pdftron
  const xfdfString = await annotationManager.exportAnnotations();

  // 3. get: flat pdf document from pdftron
  const currentDocument = documentViewer.getDocument();
  const pdfArrayBuffer = await currentDocument.getFileData({ xfdfString, flatten: true });

  // 4. covert pdfDocument ArrayBuffer to Blob to File
  const pdfUint8Array = new Uint8Array(pdfArrayBuffer);
  const pdfBlob = new Blob([pdfUint8Array], { type: 'application/pdf' });
  const pdfFile = new File([pdfBlob], 'file.pdf', { type: 'application/pdf' });
  return pdfFile;

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi @iybar,

I tested your code and was not able to reproduce this issue. Can you confirm the annotations are actually being flattened? When flattened onto a document, the annotation data will no longer exist in the annotation manager as the annotations are technically now “burned” onto the PDF; you shouldn’t be able to select them/move them.
Please also ensure that you have enabled the fullAPI as it is required for flattening.
flatten

If this does not resolve your issue are you able to share the version of WebViewer you are using? Also, which demo are you able to reproduce this on? I was not able to reproduce this in our flattening demo either:

Hi Armando,

That’s the trick :slight_smile: We forgot the fullApi flag. Thank you for the quick response!

Hi @iybar,

Sounds good, glad I could help!

Have a great rest of your day.

Best Regards,
Armando Bollain
Software Developer
PDFTron Systems, Inc.
www.pdftron.com