我有一个 RTL(从右到左)pdf 文档,想将其打印成小册子格式,以便可以双面打印并装订成书。对于 LTR(从左到右)文档,有简单的解决方案,例如pdfbook
:
pdfbook inputfile.pdf
上述简单命令将创建一个名为 的新 pdf 文件inputfile-book.pdf
,该文件可以双面打印(双面打印“长边”)。
对于从右到左的文档是否有类似的解决方案?
答案1
我发现了一个解决这个问题的方法:
为了16 页输入文件:
pdfbook --signature* 4 inputfile.pdf 16,15,14,13,6,5,8,7,10,9,12,11,4,3,2,1 --outfile book-RTL.pdf
为了14 页输入文件:
pdfbook --signature* 4 inputfile.pdf {},{},14,13,6,5,8,7,10,9,12,11,4,3,2,1 --outfile book-RTL.pdf
为了12 页输入文件:
pdfbook --signature* 4 inputfile.pdf 12,11,4,3,6,5,8,7,10,9,2,1 --outfile book-RTL.pdf
为了10 页输入文件:
pdfbook --signature* 4 inputfile.pdf {},{},4,3,6,5,8,7,10,9,2,1 --outfile book-RTL.pdf
为了8 页输入文件:
pdfbook --signature* 4 inputfile.pdf 2,1,4,3,6,5,8,7 --outfile book-RTL.pdf
答案2
PHP 学习者的回答有效,但我出于多种原因寻找其他解决方案。[这些原因包括:pdfbook 不再受到开发人员的官方支持;为了让它执行 RTL,我必须删除签名开关中的星号;该答案中给出的解决方法仅适用于特定编号的小册子,我无法弄清楚编号系统如何工作,以推断到其他尺寸的小册子]
这是使用的解决方案pdfjam
:
pdfjam --booklet 'true' --paper 'letter' --suffix 'book' --landscape --signature* '4' 'inputfile.pdf' --outfile ./
分解命令:
pdfjam
==pdfjam is the engine behind the pdfbook script (pdfjam itself is a shell-script interface to the "pdfpages" LaTeX package)
--booklet 'true'
== this is what makes pdfjam print the pdf as a booklet, as opposed to all the pages in order
(这是LaTeX 'pdfpages' 包中 '\includepdfmerge' 的键值)
--paper 'letter'
==pdfjam uses A4 by default, this will tell it to use 8.5x11 size paper
--suffix 'book'
==this will automatically add the suffix '-book.pdf' to the inputfile name to create the output file name. In order for this to work, the output file must be a directory
--landscape
==make the booklet go along the long side of the page
--signature* '4'
==4 pages on a single doublesided page. The asterisk reverses the order of the pages, giving an RTL booklet
'inputfile.pdf'
==path to input file
--outfile ./
==when a directory is used, the file name will be $inputfile-book.pdf (since we chose book as the suffix earlier. A regular pdf filename can also be used here.)