本帖最后由 yueguoxuan 于 2013-4-10 10:01 编辑
技术板块里有不少介绍制作小册子的经验帖,都是在Windows上用破解版软件。我在Linux上用开源的工具就可以搞定。效果一样的好,并且更加灵活。注意下面的例子完成了排版,为防止pdf浏览器在打印前再调整,要把打印->打印处理->页边距设置为0。
我的PC是Debian 6 amd64. 这样安装必要的开源工具:
$ sudo apt-get install pdfjam pdftk
例子1:为迪斯尼美语世界课程1制作小册子。
"Disney's World Of English book 01.pdf" 有57页。最后一页没啥内容不需要打印。第一页尺寸比其他页要大得多,所以需要单独调整尺寸。
(1)源文件名字太长,不方便用。拷贝到一临时文件。
$ cp Disney\'s\ World\ Of\ English\ book\ 01.pdf 01.pdf
(2)第一页调整为A4
$ pdfjam --paper a4paper --outfile 01p1.pdf 01.pdf 1
(3)其他页调整为A4
$ pdfjam --paper a4paper --outfile 01p2.pdf 01.pdf 2-56
(4)合并成一个文件01a4.pdf
$ pdfjam --outfile 01a4.pdf 01p1.pdf 01p2.pdf
(5)做成小册子。注意:56是01a4.pdf的总页数。"--signature"要求传入值为4的倍数。如果传入值M小于总页数N,效果就是每M页成一个小册子。
$ pdfbook --short-edge --signature 56 01a4.pdf
结果文件就是01a4-book.pdf。每逻辑页尺寸A5。用任何支持双面彩色打印机打印,并钉上骑马订即可。
例子2:为汽车镇制作小小册子。"990001汽车镇双面打印合集.pdf" 有420页。每12页是一个小册子,共35个小册子。为了节省纸张,想把每页缩小为A6,且A4双面打印。
(1) 纸张尺寸调整为A4。
$ pdfjam --paper a4paper --outfile trucka4.pdf truck.pdf
(2) 做成小册子。注意输入文件总物理页数必须为4整数倍。
$ pdfbook --short-edge --signature 12 trucka4.pdf
(3) 上面的小册子物理页数210,非4整数倍。在制作小小册子前,需要在文件最后添加2个空白页。
$ pdfjam --landscape --outfile trucka4-book2.pdf trucka4-book.pdf "1-,{},{}"
(4) 对每4物理页,交换第2和3页。
$ pdf_shuffer.py -m 4*n+3:4*n+2 trucka4-book2.pdf tmp
(5) 将相邻2物理页合并。
$ pdfjam --nup 1x2 --frame true --outfile trucka4-book3.pdf tmp/trucka4-book2.pdf
结果文件就是trucka4-book3.pdf. 每逻辑页尺寸A6。用任何支持双面彩色打印机打印,把所有A4纸拦腰切成2个A5,每3个A5钉上骑马订。
例子3:双面打印汽车镇。
与上例文件文件相同,仍然期望每页缩小为A6;另外期望删除每册的第2/3/11/12,因为每册的这几页雷同。最后只需要35张A4纸。
(1) 删除每册的第2/3/11/12页。
$ ./pdf_shuffer.py -d 12*n+2,12*n+3,12*n+11,12*n+12 /home/zhichyu/truck_town.pdf /home/zhichyu/tmp
(2) 缩小页面尺寸,每4页合并放置到一个物理页上。输出文件包含70个物理页,且页面尺寸被自动调整为A4.
$ pdfjam --nup 2x2 --delta "2mm 2mm" --frame true --outfile truck22.pdf tmp/truck_town.pdf
(3) 上面产生的文件左侧没有留出空白装订。下面的命令使得每页留出10mm空白(奇数页留左侧空白,偶数页留右侧空白)。注意缩放比例公式scale = 1 - offset * 2 / 210 = 0.95238. 另外,标准A4尺寸是:210mm x 297mm。
$ pdfjam --scale 0.95238 --offset "5mm 0" --twoside --outfile truck22o.pdf truck22.pdf
结果文件就是truck22o.pdf. 每逻辑页尺寸A6。用任何支持双面彩色打印机打印,并在左侧装订即可。
[PDFjam Examples]
1. Resize all pages to A5. Note: The scale ratio is derived from the the first page. The other pages don't scale correctly it their size are different from the first one.
$ pdfjam --paper a5paper --outfile ~/tmp/04.pdf 04.pdf
2. Rotate all pages in counter-clockwise 90 degress.
$ pdfjam --angle 90 --landscape --outfile ~/tmp/04.pdf 04.pdf
3. Remove pages 2-3 and 11-12, and insert a blank page after page 1.
pdfjam --outfile ~/tmp/04.pdf 04.pdf "1,{},4-10,13-"
4. Split a file into three parts.
$ pdfjam --outfile ~/tmp/04_part1.pdf 04.pdf "1-10"
$ pdfjam --outfile ~/tmp/04_part2.pdf 04.pdf "11-30"
$ pdfjam --outfile ~/tmp/04_part3.pdf 04.pdf "31-"
5. Merge multiple files into one.
$ pdfjam --outfile ~/tmp/04.pdf ~/tmp/04_part1.pdf ~/tmp/04_part2.pdf ~/tmp/04_part3.pdf
6. Combine multiple pages onto each sheet.
$ pdfjam --nup 2x1 --landscape --outfile ~/tmp/04.pdf 04.pdf
7. Clip a page into two pages.
Assume 01exp.pdf contains only one physical page, which consists of two logical pages, and "Paper Size: A4, Landscape (11.69 x 8.27 inch)". (01exp.pdf can be generated from "pdfjam --landscape --outfile 01exp.pdf 01a4-book.pdf 1")
Need to clip it into two pages, each "Paper Size: A4, Portrait (8.27 x 11.69 inch)".
Get the left logical page:
$ pdfjam --trim "0 0 5.85inch 0" --outfile 01expL.pdf 01exp.pdf
Get the right logical page:
$ pdfjam --trim "5.85inch 0 0 0" --outfile 01expR.pdf 01exp.pdf
8. Arrange pages into a booklet. Note to pass total page number, round up to a multiple of 4, to "--signature".
$ pdfbook --short-edge --signature 56 04.pdf