我有一個 RTL(從右到左)pdf 文檔,想以小冊子格式列印它,以便可以雙面列印並裝訂成書。對於 LTR(從左到右)文件有簡單的解決方案,例如pdfbook
:
pdfbook inputfile.pdf
上面的簡單指令將建立一個名為inputfile-book.pdf
可以雙面列印的新 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.)