最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to merge PDFs in Ghostscript while preserving paper size for each individual page - Stack Overflow

programmeradmin2浏览0评论

I'm merging PDFs using GhostScript nad I came upon an error in which the PDFs are being merged in A4 paper size and some of the the original PDF content is being displayed only in the first quarter of the page.

This is the script I'm using for merging N files into merged.pdf:

gs -dBATCH -dQUIET -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf 0.pdf 1.pdf ...n.pdf 2>&1

I managed to get it to content fill the page using the -dPDFFitPage directive, but it's only expanding content into the A4 page.

I cannot always set the paper size directly because that would lead to the same problem but in a different way.

Is there a directive or a configuration in GS that allows me to preserve paper size for each individual page?

发布评论

评论列表(0)

  1. 暂无评论