Get Icon names for annotations

Hi,

We are working on integrating pdftron into our product. As part of it, we are implementing a custom panel to show annotation information that are added to the document (We are not using default notes panel provided by pdftron since it doesn’t fulfil our requirement).
As per our analysis, we are able to access the annotation information like creation user, date, name etc. but not icon information. Is there any way where we can get the added annotation’s icon information so that we can use the same in our custom panel.
I am attaching the image for reference.

PDFTron.png

Hi,

We have a file named map.js in the UI repo, that has an array that includes all the information about each annotation, including the icon information.
https://github.com/PDFTron/webviewer-ui/blob/7.2/src/constants/map.js

This file also has functions that map the name of the annotation (key) to the object in the with all the pertinent information.
https://github.com/PDFTron/webviewer-ui/blob/7.2/src/constants/map.js#L461

You can see how in the default notes panel, we map an instance of an annotation to a key, and then that key to the object with the info such as the icon.
https://github.com/PDFTron/webviewer-ui/blob/4b20fe3ce63b62eef0fcf16f5b8facc0e1be7dee/src/components/NoteContent/NoteContent.js#L124

Let me know if this clarifies how to get the icon for each annotation type.

Best Regards,

Armando Bollain
Software Developer
PDFTron Systems, Inc.
www.pdftron.com

CONFIDENTIALITY NOTICE: This message (and any attachment to it) is intended only for the use of the individual or entity to which it is addressed in the header, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Any reproduction, distribution, modification or use of the contents of this message (and any attachment to it) by any individual or entity other than the intended recipient is prohibited. If you have received this communication in error, please notify us immediately and delete the original.

Hi,

We are using the PDFTron webviewer SDK and we haven’t found any method that exposes this information. Could you please point how can we access this info from SDK?

Thanks,
Sai Prasanna

Hello,

Can you clarify if your custom panel is being added on top of our UI, or are you customizing the UI repo?

If you are adding your custom panel outside the UI repo, then you will need to create your custom logic to map an Annotation to an icon, as the icon information is not part of the Annotation object (it is stored in the UI repo).
You can find the icons for all the annotations here:
https://github.com/PDFTron/webviewer-ui/tree/7.2/assets/icons

You could write a mapping function that maps an annotation type to a specific icon, like we do in the UI repo.

If you are adding your custom panel by customizing inside our UI repo, you can just use the functions I linked to in the last post.

Best Regards,

Armando Bollain
Software Developer
PDFTron Systems, Inc.
www.pdftron.com

CONFIDENTIALITY NOTICE: This message (and any attachment to it) is intended only for the use of the individual or entity to which it is addressed in the header, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Any reproduction, distribution, modification or use of the contents of this message (and any attachment to it) by any individual or entity other than the intended recipient is prohibited. If you have received this communication in error, please notify us immediately and delete the original.

Hi,

Yeah we are adding custom panel on top of pdftron UI. We are not customizing the repo. So, I guess we need to maintain our own map js file to get icons’ names.

Thanks for your reply :slight_smile:

Regards,
Sai Prasanna