Rotating repetively by the same value

Discussions about document viewing.
Post Reply
tfierens
Posts: 7
Joined: Wed May 12, 2010 11:28 pm

Rotating repetively by the same value

Post by tfierens » Wed Oct 05, 2011 2:55 am

Hi,

I have a ribbon which provides two split button i.e. rotate left and rotate right. The main part of the split button, displays a default rotation i.e. 90 but the popup menu in the second part of the button displays 90, 180, 270 for both the left and right buttons. When selected and user clicks on the main part of the button, I want to rotate by the last selection made by the popup.

All the logic in regards to the button, selection from popup, saving the selected rotation angle, etc... is implemented and is correct but I'm failing to understand how to rotate an pdf file by the selected angle.

For example, if you select 90 on the rotate right button and keep clicking on the main part, it should rotate 90, then 90 again, then 90 again and so on. The same applies if you select 270 from the popup, it should rotate the pdf by 270, then 270 and 270 again.

I want the rotation angle to be applied from the last rotation if that makes sense! If for example I selected rotate 90 right first, and then I select rotate 90 left, it should put the image back to its original format. If I first rotate 90 right, and then select 270 degree left, it should rotate the pdf from its 90 degree right by 270 degree left but no matter what I'm trying I don't see to be able to get this to work.

While I don't have the code in front of me, it is working for either the left or the right button exactly as expected but I just can't seem to get it to work for the opposite rotation.

Has anyone done something similar?

Thanks.

T.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Rotating repetively by the same value

Post by Loïc » Wed Oct 05, 2011 2:23 pm

Hi Thierry,

Which function of which class are you using to rotate the document ?
BTW, you should have a look on our demo application "Pages Manipulation" that probably shows what you need.

Kind regards,

loïc

tfierens
Posts: 7
Joined: Wed May 12, 2010 11:28 pm

Re: Rotating repetively by the same value

Post by tfierens » Thu Oct 06, 2011 1:17 am

Hi Loic,

Sorry, I probably should have mentioned that this was done via GDViewer. I'm not using the PDF library in this instance.

Regards,

Thierry

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Rotating repetively by the same value

Post by Loïc » Thu Oct 06, 2011 1:49 pm

Hi,

The GdViewer opens document as read-only mode and do not apply modification on the document on page change.

The best way is to:

- Open a PDF using a GdPciturePDF object
- Display the document using GdViewer.DisplayFromGdPicturePDF
- Apply page rotation with the GdPciturePDF object and not using the GdViewer

You can find a comprehensive code in the demo I mentioned on my previous reply.

Kind regards,

Loïc

tfierens
Posts: 7
Joined: Wed May 12, 2010 11:28 pm

Re: Rotating repetively by the same value

Post by tfierens » Thu Oct 06, 2011 10:58 pm

Thanks Loic.

I'll have a look at that demo you mentioned.

Will the method you suggested above work in just a visual manner. I don't want to actually save the rotation. I just want to rotated it on screen and then let the user click a save button if they want to save the rotation, but in most case, it will not be saved just rotated.

Cheers.

T

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest