Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Can’t get size information.

Question

I am trying to get the size of the pdf document and it is returning the wrong values. I have tried this with three different pdfs. I even made one with photoshop at 1x52 dimension and it still returns that my dimensions are 792x612. Here's some of my code.

// Open PDF File
pdfHandle = qp.DAOpenFile("C:\\test2.pdf", null);

pageCount = qp.DAGetPageCount(pdfHandle);

int pageHandle = qp.DAFindPage(pdfHandle, 1);

int pageWidth = qp.PageWidth();
int pageHeight = qp.PageHeight();
int pageWidth2 = qp.DAGetPageWidth(pdfHandle, pageHandle);
int pageHeight2 = qp.DAGetPageHeight(pdfHandle, pageHandle);

Notice I tried the DA function and standard function, both return the same wrong number. I have also tried getting every available box there is using GetPageBox, all return that the right box boundry is 612 and the top boundry is 792.

Please help. I really like this library so far and I'm hoping we can get it to work for our application.

I am using a trial, but I can't buy until I see this working. It's very important to our application.

Answer

612 x 792 points / 8.50 x 11 inches is the standard Letter paper size. PDF files using points as their default measurement unit, but you can choose which measurement units you want to use by specify it using the SetMeasurementUnits function. I've tested a range of files on my end and while the majority of them used the Letter paper size, when I tested files that did not, it accurately picked up the correct size.

Could you be confused about the measurement unit that is used as the default? If not, and you're certain that you have a file that Quick PDF Library does not return the correct page size for, please send the file to our support team and we will investigate this further.


© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum