Rotate Custom annotation

WebViewer Version: 7.3.3

Do you have an issue with a specific file(s)? Yes
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? Yes
Is your issue related to annotations? Yes

Please give a brief summary of your issue:
Custom Annotations do not have the ability to rotate.

Please describe your issue and provide steps to reproduce it:
I am creating a custom annotation to be able to render a custom annotation, and I need the ability to rotate that annotation to place it in the correct place of the document, that sometimes could be in a different angle.
At the moment the example provided by PDFTron on its website only shows how to make a custom annotation resizable, but not how to make that annotation capable of rotating itself. (Link)

Moreover the Annotations.RotationControlHandle is not public, but you can find it in the official documentation.

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

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:

Guides:APIs:Forums:

Hi,

Unfortunately the functionality is not supported right now at this time of writing.
Sorry for the inconvenience.

Anthony Chen

Hi Anthony,

If you read the documentation, you can find out the “Rotation” property is working for FreeHand, Polyline, Polygon and Stamp… but I am not able to make a stamp able to rotate… I could change my annotation to be a Stamp, so how can I make it rotate?

Thanks

Hey Daniel,

I’m getting slightly confused.

You mentioned:

Moreover the Annotations.RotationControlHandle is not public, but you can find it in the official documentation.

This is referring to: Freeform-rotation | Apryse Documentation

As stated above:
Unfortunately the functionality is not supported right now at this time of writing.

In your most recent reply, you mentioned: “Rotation” property.
Please note that is something else.
If you want to make the stamp rotate, please see API:
https://docs.apryse.com/api/web/Core.Annotations.Annotation.html

After you set the value, please call:
annotManager.redrawAnnotation(stampAnnot);

Anthony Chen

Hi Anthony,

Regarding Annotations.RotationControlHandle, you can find that class on the PDFTron documentation webpage, and in theory is the one you need to use to render a Rotation Button, to allow users to rotate the annotations. Even this class is in the documentation, what means it is public, when you try to create a SelectModel class for the annotation, you get an error because that class is not really public.

Regarding the Rotation property, I know I can set that property manually when I load the annotations, but I need the users to decide the rotation they want to render, and if the RotationControlHandle is not public, there is no way to show that control to the user.

I hope this helps to understand the issue.

I see what you mean now.
Thank-you for your patience in helping me clarify the issue.

So yes you are correct, although RotationControlHandle is public and documented, it looks like we did not expose it for our customers to use.

We are currently investigating and discussing with the team on how to best handle this case as stated above: currently not all annotations support this rotation control handle.

Anthony Chen

From speaking internally with the team.
We will expose the rotation control handle class so that we can use it.
We will also add additional information in the documentation of what is supported.

I will update you further once the changes are in.

Anthony

The changes have been merged to our nightly stable: https://www.pdftron.com/nightly/#stable/.
The change should be in a nightly stable build after June 25th (not inclusive) .

THanks,
Anthony