Can you reproduce using one of our samples or online demos?
Are you using the WebViewer server?
Does the issue only happen on certain browsers?
Is your issue related to a front-end framework?
Is your issue related to annotations? Yes
We leverage annotation custom data to persist a UUID corresponding to a related database entity; this enables us to synchronize existing annotation changes with our database.
We enable users to download a PDF version of a file with exported/embedded annotations on the client-side. Here is the snippet we’re using for this process:
const doc = webViewer.Core.documentViewer.getDocument();
const xfdfString = await webViewer.Core.annotationManager.exportAnnotations();
const data = await doc.getFileData({
// saves the document with annotations in it
xfdfString,
downloadType: 'pdf',
});
const arr = new Uint8Array(data);
const blob = new Blob([arr], { type: 'application/pdf' });
downloadBlob(blob, fileName);
The exported annotations contain the custom data key mentioned above. Is there a way to export annotations excluding this custom data? This custom data is not inherently problematic to the downloaded PDF file itself; however, it is posing issues for us in a downstream flow post-download.
We currently don’t have an easy way to do this, since we store rich text data inside custom-data for FreeText. You could remove the custom data then add it back in the annotation when done exporting.
Thanks for the reply, Tyler. The first option might work but does not seem ideal.
An alternative place in which we could solve our problem would be at time of initial document load. Currently, we draw the set of database-persisted annotations onto documents via a snippet that looks like this:
However, some PDF documents are uploaded with an initial set of internal/local annotations. These annotations are not persisted to the database and cause various issues when users attempt to edit them. Is there a way to interact with the initial set of internal annotations (i.e. iterate over them and interact with custom data and/or other Core.Annotations.Annotation properties)?
How are we able to retrieve the full set of Core.Annotations.Annotationobjects after the document has been loaded? I am only aware of the ability to export annotations to an XFDF string via AnnotationManager.exportAnnotations which isn’t helpful.
There are two events and if youre listening to documentLoaded to get the annotations, it would usually fail because annotations have not been parsed yet. I would listen to the annotationsLoaded event, which occurs right after documentLoaded
I loaded the document into our demo, and got the annotationList and it resulted in 2 annotations: