-
1. Re: page height is zero
olafdruemmer Jan 29, 2014 10:19 AM (in response to bobhopfner)I can't see the problem...
The MediaBox' lower left corner is at 0 / -692, and the upper right is at 792 / 0 - in other words the page is 792 units wide and 692 units high.
Make sure you never assume that the origin of the MediaBox is at 0 / 0 - it can be anywhere on teh coordinate system.
For example, if you had a MediaBox of
[-20792 -10692 -20000 -10000]
its size would still be 792 by 692.
Olaf
-
2. Re: page height is zero
bobhopfner Jan 29, 2014 12:08 PM (in response to bobhopfner)Like I said before it's an orientation problem. I am working with my developer to clarify but the gist is that he can pull in the orientation but that value is inconsistent - doesn't always jive with the page dimensions so that was why he went to look at page size and dimensions where "width being greater than height equals landscape" but apparently that is also inconsistent as page height is zero at times. He's using a pdf library from SyncFusion but he doesn't feel it's an issue with that api, but it could be. We feel like we are looking for a needle in a haystack. Too many unknowns to solve for x.
-
3. Re: page height is zero
olafdruemmer Jan 29, 2014 12:41 PM (in response to bobhopfner)But your example does not have a page height of zero... I must be missing something here.
Please make sure you understand the meainign of the values in a MediaBox array correctly: it does not directly contain width or hight, just four values representing the coordinates of the lower left and upper right corners. The width or height has to be computed by subtracting the appropriate values from each other.
-
4. Re: page height is zero
lrosenth Jan 29, 2014 5:40 PM (in response to olafdruemmer)In addition to the excellent comments from Olaf - have you opened that PDF up in Adobe Reader (or some other PDF viewer) and seen what the page size is shown there. Seems to me that the values you are getting back this 3rd party library (that no one has ever heard of!) is incorrect.
-
5. Re: page height is zero
bobhopfner Jan 29, 2014 6:41 PM (in response to lrosenth)Thanks, yes, I forgot that point that Acrobat Pro does in fact presesent a page size in either properties or the simple rollover in the corner. It's got to be in there somewhere! So then your statement begs a question: What is a good 3rd party library?
thanks!
-
6. Re: page height is zero
lrosenth Jan 29, 2014 8:58 PM (in response to bobhopfner)Adobe offers its PDFLibrary for license from Datalogics. Of course that may too much for your needs (which we don't know anything about).
-
7. Re: page height is zero
Test Screen Name Jan 30, 2014 12:33 AM (in response to lrosenth)The page size presented by Acrobat will derived from exactly four fields:
MediaBox
CropBox
Rotate
UserUnits
You state that some PDFs do not have MediaBox but that would be absolutely wrong. It is always required (the others are optional). It may not be present in the Page object, however, because it may be inherited. Not all libraries will report that.




