WebViewer Version:10.2.3
Do you have an issue with a specific file(s)?
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?
Please give a brief summary of your issue:
(Think of this as an email subject)
I want to access the annotation which i applied on my pdf and i am getting very different object while doing console.log can you help me how i can get the access of my annotations?
and i have attached the image of the object which i got while console so tell me what is the correct way to access the annotation and make the annotation readOnly
and this the code
const annotations = annotationManager.getAnnotationsList();
console.log(“annotationssss”,annotations)
5.pdf (695.7 KB)
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
Please provide a link to a minimal sample where the issue is reproducible:
1 Like
Hello, I’m AiRon, an automated tech support bot 
While you wait for one of our customer support representatives, I can help you with your question.
To access and manipulate annotations in Apryse’s WebViewer, you can use the
annotationManager
object. This object allows you to retrieve, modify, and interact with annotations on a PDF. The annotations you retrieve may include various properties, depending on their type and how they were created.
Some things you can try:
- Use the
annotationManager.getAnnotationsList()
method to retrieve all annotations in the document. This returns an array of annotation objects.
- To make an annotation read-only, iterate through the annotations and set the
ReadOnly
property to true
for each annotation you want to restrict.
- Inspect the properties of each annotation object to understand its structure and the data it contains. This can be done using
console.log
to view the object in your browser’s developer console.
- Use methods like
annotationManager.updateAnnotation()
to apply changes to annotations after modifying their properties.
Here are some resources that might help you:Hopefully, this helps you solve your problem while you wait for a human to get back to you.
1 Like
Hello Abhimanyu,
The getAnnotationsList API returns an array of all the annotations in a PDF. You can access the specific annotation by providing an index and then setting the annotation’s ReadOnly property to true.
annotations[0].ReadOnly = true; // sets the first annotation in the list to read only
Best Regards,
Darian
1 Like