JavaScript AddAnnot Rotate

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

tdonovan
User
Posts: 61
Joined: Tue Jun 12, 2007 9:21 pm

JavaScript AddAnnot Rotate

Post by tdonovan »

I interpet the Java script documentation that when adding a freetext box to a page, the rotation should be relative to the current rotation of the page. When I execute JaveScript in the control, it seems to be relative to the original rotation of the page. So if the page is rotated 90 degrees, the annotation is added relative to the zero rotation, not relative to the 90 rotation. Am I misinterpeting the documentation.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: JavaScript AddAnnot Rotate

Post by Stefan - PDF-XChange »

Hello tdonovan,

When creating a new FreeText annotation the rect array is holding the coordinates in the default user space - this is the unrotated, uncropped page.
You will need to getPageRotation, and do the necessary calculations and coding if you want to place a rotated (relative to the page) annotation.

Best,
Stefan
tdonovan
User
Posts: 61
Joined: Tue Jun 12, 2007 9:21 pm

Re: JavaScript AddAnnot Rotate

Post by tdonovan »

For a stamp annotation, per the Java documentation the rotate property only applies to Freetext, so how do I insert a stamp and have it rotated based upon the page rotation rather than default user space. It would seem to me that stamps picture itself should be inserted based upon the rotation of the page, not default user space. All help greatly appreciated.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: JavaScript AddAnnot Rotate

Post by Stefan - PDF-XChange »

Hello tdonovan,

I know that the rotate description reads:

Code: Select all

The number of degrees (0, 90, 180, 270) the annotation is rotated counterclockwise relative to the page. 
This property is only significant for free text annotations.
But it is a valid property for stamps as well.

Unfortunately this is not a supported property in our Viewer for stamps.

Regards,
Stefan
tdonovan
User
Posts: 61
Joined: Tue Jun 12, 2007 9:21 pm

Re: JavaScript AddAnnot Rotate

Post by tdonovan »

Could I please request you add the rotate feature in a future build or version 3
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: JavaScript AddAnnot Rotate

Post by Stefan - PDF-XChange »

Hello tdonovan,

It is already in the ToDo list, so it will be added at some point (probably in ver3).

Best,
Stefan