Reset Page orientation to match Page Rotation

Questions, comments and suggestions concerning VintaSoft PDF .NET Plug-in.

Moderator: Alex

Post Reply
kwaltman
Posts: 30
Joined: Fri Aug 07, 2009 9:48 pm

Reset Page orientation to match Page Rotation

Post by kwaltman »

Currently, I have a few PDFs that view correctly as landscape pages. But internally, they are defined as portrait pages and with the page rotation set to 90 degrees.

Is there a way to force or reset the orientation of the page to match the current rotation value is? Or resave the PDF to match the current view orientation so when reopened it views as expected, but the page rotation is now zero? or to reset the coordinate system and objects to match the currently viewed orientation?

I ask because this presents several issues when trying to draw on the PDF, and the coordinate system is then 90, 180 or 270 out of skew relevant to how the page is being viewed.

Please let me know,

-Kev
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Reset Page orientation to match Page Rotation

Post by Alex »

Hello Kevin,

Do you have annotations on PDF page?

If PDF page does not contain annotations, current version (12.1.11.1) of VintaSoft Imaging .NET SDK can correctly rotate content of PDF page.

If PDF page contains annotations, we need to create special algorithm that correctly rotates content of PDF page with annotations.

Best regards, Alexander
kwaltman
Posts: 30
Joined: Fri Aug 07, 2009 9:48 pm

Re: Reset Page orientation to match Page Rotation

Post by kwaltman »

There are no annotations on the page.
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Reset Page orientation to match Page Rotation

Post by Alex »

In next minor version we will add PdfPage.RemoveRotation method that will allow to remove rotation of PDF page. I think new minor version will be available next week.

Best regards, Alexander
kwaltman
Posts: 30
Joined: Fri Aug 07, 2009 9:48 pm

Re: Reset Page orientation to match Page Rotation

Post by kwaltman »

Perfect, thanks!
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Reset Page orientation to match Page Rotation

Post by Alex »

Hello Kevin,

In version 12.1.12.1 we have added new method - PdfPage.RemoveRotation, which rotates content of PDF page and sets PdfPage.Rotate property to 0. Please use version 12.1.12.1 and let me know if you will have any question or problem.

Best regards, Alexander
kwaltman
Posts: 30
Joined: Fri Aug 07, 2009 9:48 pm

Re: Reset Page orientation to match Page Rotation

Post by kwaltman »

Alex,

Thank you for getting this added. But, there appears to be a problem with this new method. It does remove the viewer rotation, but in the process, the page is clipped to a square when the orientation doesn't match.

So the RemoveRotataion works fine when the Page.Rotate was set to 180. But when set to 90 or 270 it clips the page.

I think the problem is shown in the ArtBox values. Before the RemoveRotation the ArtBox Width is 792 and the Height is 611. Afterward, the Artbox Width is 611 and the Height is also 611. So, I think this explains the clipping to a square.

If you need samples to illustrate this I can email them to you.

Please advise.

-Kev
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Reset Page orientation to match Page Rotation

Post by Alex »

Hello Kevin,

Thank you for information. Please send sample PDF document to support@vintasoft.com. We need to analyze document.

Best regards, Alexander
Post Reply