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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - PageWidth/PageHeight sometimes problem
  FAQ FAQ  Forum Search   Register Register  Login Login

PageWidth/PageHeight sometimes problem

 Post Reply Post Reply
Author
Message
HNRSoftware View Drop Down
Senior Member
Senior Member


Joined: 13 Feb 11
Location: Washington, USA
Status: Offline
Points: 88
Post Options Post Options   Thanks (0) Thanks(0)   Quote HNRSoftware Quote  Post ReplyReply Direct Link To This Post Topic: PageWidth/PageHeight sometimes problem
    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
Back to Top
rweetch View Drop Down
Senior Member
Senior Member


Joined: 22 Feb 11
Status: Offline
Points: 173
Post Options Post Options   Thanks (0) Thanks(0)   Quote rweetch Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 18 at 8:26PM
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

Back to Top
HNRSoftware View Drop Down
Senior Member
Senior Member


Joined: 13 Feb 11
Location: Washington, USA
Status: Offline
Points: 88
Post Options Post Options   Thanks (0) Thanks(0)   Quote HNRSoftware Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 18 at 10:29PM
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
Back to Top
rweetch View Drop Down
Senior Member
Senior Member


Joined: 22 Feb 11
Status: Offline
Points: 173
Post Options Post Options   Thanks (0) Thanks(0)   Quote rweetch Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 18 at 12:21AM
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. 


Back to Top
HNRSoftware View Drop Down
Senior Member
Senior Member


Joined: 13 Feb 11
Location: Washington, USA
Status: Offline
Points: 88
Post Options Post Options   Thanks (0) Thanks(0)   Quote HNRSoftware Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 18 at 12:45AM
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....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store