PXCp_PageGetBox

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
relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

PXCp_PageGetBox

Post by relapse »

Hello!

My question is: should I explicitly set the value of the CropBox before I retrieve it with the PXCp_PageGetBox method for the first time? If I've loaded a pdf document with the viewer and retrieve its CropBox with the JS via getPageBox() - it functions. If I've set the value with the PXCp_PageSetBox method one time, it is no problem to retrieve it any time later. But if I use PXCp_PageGetBox for the first time it returns the value -2112936170 ("Required property is not set.")

Code: Select all

PXC_RectF rect;
var retVal = PdfXchangePro.PXCp_PageGetBox(pdfHandle, 0, PXC_PageBox.PB_CropBox, out rect);
Thanks for your reply!
User avatar
Lzcat - Tracker Supp
Site Admin
Posts: 677
Joined: Thu Jun 28, 2007 8:42 am

Re: PXCp_PageGetBox

Post by Lzcat - Tracker Supp »

Hi.
No, you may not set CropBox if it is not needed. Page can have several different boxes - MediaBox, CropBox, BleedBox, TrimBox, ArtBox, and only MediaBox is required. If any Box is not set for page JS will reurn default value (for CropBox it will be value of MediaBox, and for all others - value of CropBox). But xcpro will return box only if it was set for page. So it is safe to ignore this error (or if you really need CropBox - replace it with MediaBox if not present).
HTH.
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

Re: PXCp_PageGetBox

Post by relapse »

Thanks, your information is helpful for me!


P.S. Is there always a MediaBox in a pdf document?
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: PXCp_PageGetBox

Post by John - Tracker Supp »

There should be - its part of the PDF Specification :)

HTH
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
relapse
User
Posts: 167
Joined: Wed Jan 18, 2012 11:10 am

Re: PXCp_PageGetBox

Post by relapse »

That sounds excessively positive! :D

Thanks!
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: PXCp_PageGetBox

Post by John - Tracker Supp »

We live in a constant state of optimism here ;)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
Post Reply