Discussion:
identify & display PDF CropBox?
Michael Howard
2011-02-04 14:26:09 UTC
Permalink
My quesiton relates to PDF files ... not directly an ImageMagick issue.

I am working with PDF files.
Some of the pages in some of the files have a CropBox that is smaller
than the MediaBox.
ImageMagick tools are properly respecting the parameter -define
pdf:use-cropbox=true

I need to access the CropBox coordinates on a page-by-page basis.
IM "identify" does not seem to support the display of any
format-specific properties like CropBox.

Q: Does anyone have recommendations about how I can extract/display
the CropBox dimensions of pages within a PDF file?


Thanks,
Michael
Wolfgang Hugemann
2011-02-07 10:54:21 UTC
Permalink
As PDF is pure ASCII, you could use FIND (Windows) or -- more
sophisticated -- SED (Linux or Windows) to extract that information from
the PDF file. Keep in mind that it is mostly written as 'CropBox' within
PDF files, so your search should better be case-insensitive.

Wolfgang Hugemann
Michael Howard
2011-02-07 14:57:28 UTC
Permalink
Wolfgang,

Thank you for your response.

I am only beginning to learn about PDF format ...

I wondered about performing a text search, but was concerned about the
following:

Q: Is it possible that some attributes (like CropBox) might be
"inherited" and not defined on a page-by-page basis?

Q: Is it the case that the document pages will be in the same order in
the PDF file?


Thanks,
Michael
Post by Wolfgang Hugemann
As PDF is pure ASCII, you could use FIND (Windows) or -- more
sophisticated -- SED (Linux or Windows) to extract that information from
the PDF file. Keep in mind that it is mostly written as 'CropBox' within
PDF files, so your search should better be case-insensitive.
Wolfgang Hugemann
_______________________________________________
Magick-users mailing list
http://studio.imagemagick.org/mailman/listinfo/magick-users
Wolfgang Hugemann
2011-02-07 15:24:10 UTC
Permalink
Post by Michael Howard
Q: Is it possible that some attributes (like CropBox) might be
"inherited" and not defined on a page-by-page basis?
Q: Is it the case that the document pages will be in the same order in
the PDF file?
Well, remember, this an IM forum, it's not about PDF.

I am quite sure that the CropBox can be defined on a per page basis.
This is basically what you do when you crop single pages in a document
with, say, Adobe Acrobat.

The structure of a non-optimised PDF is non-linear, see
http://en.wikipedia.org/wiki/Portable_Document_Format#File_structure, so
you cannot expect the pages in a PDF to be in order. Nevertheless they
probably will be in order if the PDF was created by a PDF printer driver
as is the standard procedure.

Wolfgang Hugemann

Loading...