I am using PDF::Reuse
to munge some PDFs. I have the dimensions of the PDFs in question stored in a database, so when I create a new one, I can use the rMbox
function to set the right size. Unfortunately, some of my source PDFs appear to be in landscape mode, so the X and Y coordinates are essentially reversed. However, the coordinates, which come from pdfinfo
, are always in X,Y order regardless of orientation. This results in the munged PDFs being cut off as the content ends up outside the page boundaries.
I also tried using Image::Magick to get the size of each PDF, but the dimensions are reported in the same order as pdfinfo so that's no help. If anyone knows an easy and reliable way to determine the orientation of a PDF (or to simply get the dimensions in the right order in the first place) I would be very grateful.