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;