Detailed description of issue
Trying to download PDF document with added annotations by WebViewer UI using instance.downloadPdf, but instead get a file without annotations.
Expected behaviour
To download document with annotations added in Viewer.
Link to document
Code snippet
WebViewer(...)
.then(function(instance) {
var docViewer = instance.docViewer;
var annotManager = instance.annotManager;
// you must have a document loaded when calling this api
docViewer.on('documentLoaded', async function() {
// download pdf without annotations added by WebViewer UI
instance.downloadPdf({
includeAnnotations: false,
});
// download pdf with all annotations flattened
instance.downloadPdf({
includeAnnotations: true,
flatten: true,
});
// download pdf without links
const xfdfString = await annotManager.exportAnnotations({ links: false });
instance.downloadPdf({
xfdfString: xfdfString,
});
});
});
PDF.js Express does not support flattening annotations on the client. To get this functionality, you can either use the merge rest API, or try out our sister product, PDFTron Webviewer (which has this functionality client side).
Could you please help with advice?
When I merged annotations with rest API, how is it possible to flatten it?
I want to get PDF document where all form fields and signature are read-only\static.