1

我有一个大小为 8.27 英寸 × 10.87 英寸的 PDF,但我工作的打印机要求页面为美国信纸大小(8.5 英寸 x 11 英寸)。ImageMagick 可以通过以下方式实现大小调整:

convert -page Letter mypdf.pdf mypdf-converted.pdf

生成的 pdf 为 8.5x11,打印效果很好,但 pdf 中的文本和图像被拉伸了。我想要的是原始 8.27x10.87 页面的精确副本粘贴在 8.5x11 页面上,没有拉伸内部内容。理想情况下,内容将居中,但将内容与一侧对齐也很好。

我弄乱了一些 -filter 选项,但无济于事。我所描述的内容有选择吗?

另外,请注意:我尝试在 Document Viewer(默认的 Linux PDF 查看器)中将文件打印到 PDF 并调整页面设置,但这导致了我认为奇怪的字符编码问题。出于某种原因,我可以在我的计算机上很好地查看 pdf,但是打印机会打印出很多“!”和“%”以及其他随机字符来代替文本。ImageMagick 生成的 PDF 不会导致任何此类问题。

谢谢!

4

1 回答 1

1

You can use our free cpdf tool:

Coherent PDF Command Line Tools Community Release

First, change the size of the pages:

cpdf -mediabox "0 0 8.5in 11in" in.pdf -o out.pdf

Then, shift the contents rightward and upward by half the difference in size:

cpdf -shift "0.115in 0.0515in" out.pdf -o out2.pdf

Or, all together:

cpdf in.pdf -mediabox "0 0 8.5in 11in" AND -shift "0.115in 0.0515in" -o out.pdf
于 2013-09-11T18:38:45.007 回答