[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

resizing PDF files with Ghostscript



I am trying to use Ghostscript to resize PDF files to letter page size,
but on certain files the output is not the correct size.  As an example:

   $wget https://gmarks.org/abrams_anh_pardo.pdf

   $pdfinfo abrams_anh_pardo.pdf 
   ...
   Page size:      539 x 737 pts
   ...

   $gs -o resized_file.pdf -sDEVICE=pdfwrite -dFIXEDMEDIA -dPDFFitPage -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -dBATCH -dSAFER abrams_anh_pardo.pdf

   $pdfinfo resized_file.pdf 
   ...
   Page size:      579.224 x 792 pts
   ...

Despite the flags -dDEVICEWIDTHPOINTS=612 and -dDEVICEHEIGHTPOINTS=792,
the page size of the output file is 579.224 x 792 pts instead of 612 x
792 pts.  (Interestingly, Ghostscript did change the page size, just
not to the correct dimensions.)  As some printers will refuse to print
files that aren't 612 x 792, I'd like to be able to convert such files
correctly.  How does one do that with Ghostscript?

Incidentally, the command

   $pdfjam --outfile resized_file.pdf --paper letter abrams_anh_pardo.pdf

does produce the correct output; however, on certain PDF files, pdfjam
yields output files with blank pages, so I'd like to be able to use
Ghostscript as an alternative.

Best regards,
Greg Marks

Attachment: signature.asc
Description: PGP signature


Reply to: