本文介绍了Ghostscript:添加BleedBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有pdfInfo的pdf:

I have a pdf with such pdfInfo:

pdfinfo -f 1 -l 1 -box book.pdf 
Title:          Hibaby book
Author:         Hibaby.biz
Creator:        HIBABY
Producer:       TCPDF 5.9.193 (http://www.tcpdf.org)
CreationDate:   Tue Mar  5 17:25:23 2013
ModDate:        Tue Mar  5 17:25:23 2013
Tagged:         no
Form:           none
Pages:          21
Encrypted:      no
Page    1 size: 595.276 x 841.89 pts (A4)
Page    1 rot:  0
Page    1 MediaBox:     0.00     0.00   595.28   841.89
Page    1 CropBox:      0.00     0.00   595.28   841.89
Page    1 BleedBox:     0.00     0.00   595.28   841.89
Page    1 TrimBox:      0.00     0.00   595.28   841.89
Page    1 ArtBox:       0.00     0.00   595.28   841.89
File size:      3771955 bytes
Optimized:      no
PDF version:    1.7

跟随线程,我尝试调整大小并添加使用以下命令的bleeBox:

following this thread I try to resize and add a bleeBox with this command:

gs -o output.pdf \
   -sDEVICE=pdfwrite \
   -r72 \
   -dPDFA \
   -sProcessColorModel=DeviceCMYK \
   -dFIXEDMEDIA \
   -dDEVICEWIDTHPOINTS=667 \
   -dDEVICEHEIGHTPOINTS=913 \
   -c "[/ArtBox[36 36 631 877]" \
   -f book.pdf

我只得到了一个略大的pdf,带有正确的mediabox,但没有附加bleedbox ...我想念什么?

i only get a slightly bigger pdf with correct mediabox but no bleedbox attached... what Am I missing?

pdfinfo -f 1 -l 1 -box output.pdf 
Producer:       GPL Ghostscript 9.06
CreationDate:   Fri May 17 11:10:49 2013
ModDate:        Fri May 17 11:10:49 2013
Tagged:         no
Form:           none
Pages:          21
Encrypted:      no
Page    1 size: 595.276 x 841.89 pts (A4)
Page    1 rot:  0
Page    1 MediaBox:     0.00     0.00   667.00   913.00
Page    1 CropBox:      0.00     0.00   595.28   841.89
Page    1 BleedBox:     0.00     0.00   595.28   841.89
Page    1 TrimBox:      0.00     0.00   595.28   841.89
Page    1 ArtBox:       0.00     0.00   595.28   841.89
File size:      534004 bytes
Optimized:      no

我不明白什么地方出了问题:命令,语法,或者如果我只是想使某些事情变得不可能谢谢您的帮助!

I don't understand what is wrong: the command, the syntax or if I'm just trying to make something impossiblethanks for any help!

PDF版本:1.4

PDF version: 1.4

推荐答案

首先,您在命令行中均未指定BleedBox.您确实提到了ArtBox,但这不是一回事.

Firstly, nowhere in your command line do you specify a BleedBox. You do mention an ArtBox but that's not the same thing.

其次,您不能只是将/ArtBox随意粘贴在PostScript流中并期望它可以执行任何操作.此"[/ArtBox [36 36 631 877]"甚至都不是有效的PostScript,因为您有不平衡的数组标记.

Secondly, you can't just arbitrarily stick a /ArtBox in the PostScript stream and expect it to do anything. This "[/ArtBox[36 36 631 877]" isn't even valid PostScript because you have unbalanced array marks.

您的命令行应改为

-c "[/ArtBox [36 36 631 877] /PAGES pdfmark" -f

除非您实际上确实想要BleedBox,否则必须将/ArtBox替换为/BleedBox.

Unless You actually do want a BleedBox in which case you will have to replace the /ArtBox with /BleedBox.

这篇关于Ghostscript:添加BleedBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 00:18