Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
PageWidth/PageHeight sometimes problem |
Post Reply |
Author | |
HNRSoftware
Senior Member Joined: 13 Feb 11 Location: Washington, USA Status: Offline Points: 88 |
Post Options
Thanks(0)
Posted: 18 May 18 at 4:05PM |
This one is driving me crazy. I have pretty simple code that opens a file, loads a page, sets origin to "1" (Top left), measurementunits to "2" (inches), and and then fetches PageHeight and PageWidth. It works just fine for "normal" paper pages such as 8.5x11 and 11x8.5. My problem is an architectural drawing which is 36" wide by 24" tall. Adobe Acrobat reports it correctly and renders it correctly (as a wide image). QuickPDF also renders it as a wide image, but "GetPageHeight" and "GetPageWidth" return the wrong values -- they say that the page is 24" wide by 36" tall. Simplifying out the origin and measurement units doesn't change anything significant. My sequence is: .Create/.UnlockKey/.LoadFromFile/.SelectPage and then use .PageWidth and .PageHeight. GetPageBox calls return similarly wrong information. Documentation search does not return anything on "orientation" which is the sort of thing I would expect to control a situation like this. Anyone have any ideas as to what might be going on? It is theoretically possible that the file was created oddly, but Acrobat is happy with it and QuickPDF renders it rationally. I can provide the file as needed. thanks - Howard P.S. - when I get this one nailed down, I will go on to weirdness in SetCropBox and the PageBoxes.
Edited by HNRSoftware - 18 May 18 at 4:06PM |
|
rweetch
Senior Member Joined: 22 Feb 11 Status: Offline Points: 173 |
Post Options
Thanks(0)
|
Have you checked the page rotation?
http://www.debenu.com/docs/pdf_library_reference/PageRotation.php maybe that might help shed some light on it
|
|
HNRSoftware
Senior Member Joined: 13 Feb 11 Location: Washington, USA Status: Offline Points: 88 |
Post Options
Thanks(0)
|
YES! - that was it. I was so focused on "orientation" that I did not think about "rotation". That will probably affect my CropBox weirdness as well. Thank you for pointing me in this direction. Howard
|
|
rweetch
Senior Member Joined: 22 Feb 11 Status: Offline Points: 173 |
Post Options
Thanks(0)
|
I can never remember what the integer values mean so I created a pdf.types file which contains enumerated types for the values I use a lot e.g. TpdfMeasurementUnits = (pmuPoint, pmuMillimetres, pmuInches, pmuPixels). I then have a class helper with proxy properties (in the case MeasurementUnits) and methods which then call the appropriate methods on the underlying DebenuPDF object.
|
|
HNRSoftware
Senior Member Joined: 13 Feb 11 Location: Washington, USA Status: Offline Points: 88 |
Post Options
Thanks(0)
|
I use equivalent logic, but have separate conversion to and from strings so I can avoid having to memorize them. This rotation question was just the tip of the iceberg on actually working with page boxes (primarily "CropBox"). I don't think I am discovering any actual bugs, but the way it works with rotated pdfs is a trifle weird. The default origin for QuickPDF is lower right, and I am an old Delphi guy and insist on working with (0,0) as the upper left corner. I've just tried writing some sentences describing the counter-intuitive nature of working with rectangle heights and widths and file page heights and widths in a page with a 90 degree rotation, and gave up -- X-ish terms cause Y-ish changes -- I may figure out the simple interpretation, but I'm not there yet. This is fun, in a masochistic way....
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store