我有几百个PDF需要裁剪,我愿意裁剪实际文档或者只是在每个文档中添加一个裁剪框,这样当打开PDF时就能显示正确的可视区域。
如何使用Ghostscript(v8.71)来做到这一点?我找到了以下命令:
更新:修正语法后仍然没有裁剪框,请参见以下结果:
注意:本文涉及IT技术内容,翻译时应注意专业性和准确性。
如何使用Ghostscript(v8.71)来做到这一点?我找到了以下命令:
gs -sDEVICE=pdfwrite -sOutputFile=marked.pdf [/CropBox [54 54 1314 810] /PAGES pdfmark original.pdf
我已经尝试过这个命令(和我能想到的所有变体),但总是会出现错误,例如:
Error: /undefinedfilename in ([/CropBox)
我尝试移动命令的参数,但没有任何效果。有人知道怎么做吗?更新:修正语法后仍然没有裁剪框,请参见以下结果:
pdfinfo -box -f 1 -l 3 original.pdf
Producer: PDFlib 7.0.2 (PHP5/Linux)
CreationDate: Wed Oct 21 11:41:04 2009
ModDate: Wed Oct 21 13:38:22 2009
Tagged: no
Pages: 1
Encrypted: no
Page 1 size: 1423 x 918 pts
Page 1 MediaBox: 0.00 0.00 1423.00 918.00
Page 1 CropBox: 0.00 0.00 1423.00 918.00
Page 1 BleedBox: 54.00 54.00 1369.00 864.00
Page 1 TrimBox: 0.00 0.00 1423.00 918.00
Page 1 ArtBox: 0.00 0.00 1423.00 918.00
File size: 914373 bytes
Optimized: no
PDF version: 1.4`
查询结果: pdfinfo -box -f 1 -l 3 marked.pdf
Producer: GPL Ghostscript 8.71
CreationDate: Wed Apr 27 15:43:38 2011
ModDate: Wed Apr 27 15:43:38 2011
Tagged: no
Pages: 1
Encrypted: no
Page 1 size: 1423 x 918 pts
Page 1 MediaBox: 0.00 0.00 1423.00 918.00
Page 1 CropBox: 0.00 0.00 1423.00 918.00
Page 1 BleedBox: 0.00 0.00 1423.00 918.00
Page 1 TrimBox: 0.00 0.00 1423.00 918.00
Page 1 ArtBox: 0.00 0.00 1423.00 918.00
File size: 392382 bytes
Optimized: no
PDF version: 1.4
更新:已发布示例PDF文件 -
注意:本文涉及IT技术内容,翻译时应注意专业性和准确性。