PDF.js Express Version
7.1.2
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,
});
});
});