Question, About attachments for annotations

WebViewer Version:
10.4.0.

Do you have an issue with a specific file(s)?
No.
Can you reproduce using one of our samples or online demos?
No.
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?
No.

Please give a brief summary of your issue:
(Think of this as an email subject)
Question, About attachments for annotations.

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
Hello,

About attachment file.

My system saves annotations as XFDF strings in the DB.
Therefore, the attached file data will also be saved in the DB.
I don’t want to overwhelm the DB, so I want to save file data in storage.


Annotation.getAttachments() API return value,
content is compressed data of the attachment.


image

Can I get or set data from it?
(If so, I would like some sample code.)

Or is there a better way?

Best Regards.

Please provide a link to a minimal sample where the issue is reproducible:

1 Like

Hi okabe.yasufumi,
We will take a look at the question presented and will contact you as soon as we have more information.

1 Like

Hello Okabe,
You could try and use the following code snippet:

const xfdfString = await instance.Core.annotationManager.exportAnnotations();
localStorage.setItem('annotations', xfdfString);

You can also pass annotationList within exportAnnotation to select which annotations you want to export. You can read more about it here: Apryse WebViewer Class: AnnotationManager

1 Like