Get annotation type in English

WebViewer Version: 8.1.0

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

Please give a brief summary of your issue:
When switching the language, we get the subject of the annotation in that language.
Ex: Rectangle annotation subject

  • in English ‘Rectangle’
  • in Italien ‘Rettangolo’

Is there a way to get the subject only in English since we do some checks in our code on this value.
Or there is another property that we can use (I couldn’t find another one).

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hi @soualhi.said,

What we do in the UI to check for a type of annotation, is to use the instanceof operator. So for example here we use it as such:

We also check for the toolName, so that’s something else you could try. But in a nutshell, you should be able to do something like:

const { Annotations } = instance;

myAnnotation instanceof Annotations.RectangleAnnotation

Let me know if this works out for you.

Armando Bollain
Software Developer
PDFTron Systems, Inc.