The values returned from PDPageGetBBox don't match the page size values shown by Acrobat
Estimated Reading Time: 1 MinutesThe retrieved values of PDPageGetBBox are members of an ASFixedRect structure, which stores four ASFixed variables for use in defining rectangular areas:
Left Top Right Bottom
The variables are defined in the asexpt.h header file.
These are ASFixed values, which need to be converted to obtain their original point-value forms.
Library functions are available for conversion, such as ASFixedToFloat in this example:
ASFixedRect BBox; ... PDPageGetBBox (InPage, &BBox); printf("BBox.left = %f \n", ASFixedToFloat(BBox.left)); printf("BBox.top = %f \n", ASFixedToFloat(BBox.top)); printf("BBox.right = %f \n", ASFixedToFloat(BBox.right)); printf("BBox.bottom = %f \n", ASFixedToFloat(BBox.bottom));
The same conversion requirements hold true for PDPageGetMediaBox(), PDPageGetCropBox(), and PDPageGetBox().
Note that when Acrobat/Reader displays a page's dimensions, it reports the CropBox.