0

Im trying to use Ghostscript to create a PDF with multiple identical pages. I will later use this together with another multipaged PDF to stamp on unique information onto every page.

Is it possible to use Ghostscript to create such a PDF and keep the size of the final file down? Maby there is a flag that i have not noticed that can do this in a better way than the script below?

I have tried to use a regular merge command like the one below but the size of the resulting PDF grows alot and the original file size of 2,061kb merged to a 100page pdf results in a final size of 46,117kb.

"C:\Program Files\gs\gs9.20\bin\gswin64.exe"^
 -dBATCH^
 -dNOPAUSE^
 -q^
 -sDEVICE=pdfwrite^
 -sOutputFile=outputpdf.pdf^
 "inputpdf.pdf"^
 "inputpdf.pdf"^
 "inputpdf.pdf"(and so on 100 times)
0

Try to add -dPDFFitPage to your command.

This is from documentation:

Rather than selecting a PageSize given by the PDF MediaBox, BleedBox (see -dUseBleedBox), TrimBox (see -dUseTrimBox), ArtBox (see -dUseArtBox), or CropBox (see -dUseCropBox), the PDF file will be scaled to fit the current device page size (usually the default page size)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.