Saving a rotated PDF

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

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

vincentt
User
Posts: 6
Joined: Tue Feb 24, 2015 10:05 pm

Saving a rotated PDF

Post by vincentt »

Hi,

Problem statement:
We use the PDF-XChange Viewer in a web application to show PDF files. These PDF files are created by processing images that are scanned on a Fax or Digital Copier machine. The PDF files arrive arrive in potrait but many a time these documents come upside down as they may be scanned so. When the PDF is opened, there is a toolbar to rotate them. I clicked rotate 2 times for 180 degrees (so now technically correct way up) and click Save As a new file.

Issue:
However when I open the newly saved files, its still in the original orientation (upside down).

I have tried these codes in C# and also in the viewer
axCoPDFXCview1.SaveDocument(nActiveDocID, DownloadedFileName + ".pdf", 0, 0);
axCoPDFXCview1.SaveDocument(nActiveDocID, DownloadedFileName + "turned.pdf",3,0);

but they don't seem to work and hold on to the rotate.

Any clues for me?

P.S. I do realize that there is a rotate feature, but that would require me to track which way the use had rotated the PDF. That is another way which I could use, any hints in that in the code?

Thanks,
Vincent
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17949
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Saving a rotated PDF

Post by Tracker Supp-Stefan »

Hello Vincent,

The buttons you are most likely using are the "Rotate View" ones. They do not actually modify the document but rather just rotate the way you see the pages (for the current session). To be able to save the pages rotated at 180 degrees - you will need to use the Document -> Rotate Pages through the UI, or use the appropriate Rotate pages method form the Viewer AX.

Regards,
Stefan
vincentt
User
Posts: 6
Joined: Tue Feb 24, 2015 10:05 pm

Re: Saving a rotated PDF

Post by vincentt »

Thanks for the information. Is there a toolbar option for the same. I did see a menu option only.

Also is there any way to trap events of when a toolbar button is clicked? Like if I click on print or rotate page, is there a way to trap those events and write some custom code?

Thanks again!

Regards,
Vincent
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17949
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Saving a rotated PDF

Post by Tracker Supp-Stefan »

Hello Vincent,

Permanent pages rotations is done on a range of pages (could be the full document of course) - so there are buttons that you can add to the toolbar (customize it), but they will either need a selection in the thumbnails pane or ask the user for further info.

You can capture various events and get notifications for them.

Regards,
Stefan