Determine content alignment so page can be rotated if necessary

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

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

Post Reply
pmazurk
User
Posts: 27
Joined: Tue Feb 22, 2011 10:25 pm

Determine content alignment so page can be rotated if necessary

Post by pmazurk »

We need to detect the alignment of content on a page so we can rotate that page such that the content is correctly oriented. I know about PXCp_PageGetRotate and PXCp_PageSetRotate. Those calls turn the page from landscape to portrait or some variation of that, but they do not change the orientation of the content. If we can detect the orientation of the content we can call PXCp_PageSetRotate to correct it. Are there any functions that can detect content alignment?

Also - I'm finding that PXCp_PageGetRotate always returns 270 if the page is in landscape. Why does it not return 90 if it's in landscape upside down?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Determine content alignment so page can be rotated if necessary

Post by Tracker Supp-Stefan »

Hello pmazurk,

I am afraid that we do not offer such algorithms. There might be some available somewhere - but it is really hard to determine the orientation a page should have even if there is actual text on it - and in some cases it might be a scanned and rotated page.
Please take a look at the attached sample - it is not possible in it to determine which is the correct orientation. I know this is an extreme case - but it is to illustrate our reasoning as to why we do not offer such algorithms ourselves.

If your task is more specific - can you please try explaining it in a bit more detail?

Regards,
Stefan
Attachments
sample_1.pdf
(4.22 KiB) Downloaded 241 times
Post Reply