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, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

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

Determine content alignment so page can be rotated if necessary

Post by pmazurk » Fri Nov 30, 2018 5:46 pm

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: 13548
Joined: Mon Jan 12, 2009 8:07 am
Location: London

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

Post by Tracker Supp-Stefan » Thu Dec 06, 2018 1:19 pm

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?

(4.22 KiB) Downloaded 44 times

Post Reply