Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've written a small script to merge various reports in PDF format into one big PDF file and add some comments into the reports. It is working quite well, but I have a problem if some of the reports have pages in landscape format. What is happening is that the landscape pages are being changed to portrait and the content on the pages is being cropped.

I am using PDF::Reuse. Does anyone have any suggestions how I can keep the page layout when I merge files?

Thanks.

Replies are listed 'Best First'.
Re: Problems merging PDFs
by Albannach (Monsignor) on Feb 26, 2004 at 15:08 UTC
    You certainly can have mixed page layouts in a single PDF, and good Saint rob_au provided a working demonstration here.

    Update: I have actually tested this script by merging one PDF containing all portrait pages, and another containing all landscape pages, and it displayed exactly as desired (using Acrobat 5.1.0 under Win2k). Perhaps there is something odd about your original PDFs?

    --
    I'd like to be able to assign to an luser

      Unfortunately this script does the same as mine with landscape pages - makes them portrait and crops them. Any other suggestions?

      Thanks.

      Probably is out PDFs since when I used ghostscript to do it had the same problem and got a stack of warning about the PDFs.

      Will see what I can about my PDFS.

      Thanks for you help.

Re: Problems merging PDFs
by Chady (Priest) on Feb 26, 2004 at 14:46 UTC

    As far as I know, you can't have mixed page layouts in a single PDF file.

    So you just have to decide which layout to use, and rotate the pages that do not follow that layout into the merged file, so that when you print you have both layouts readable (although one will have to rotate the page 90° to read)


    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/