我有一个pdf文件。我想将一个给定的页面(第5页,为了方便)保存为其他pdf文件。我该如何做到这一点?
到目前为止,我已经使用了pdf gem -但它适用于读取pdf-reader (虽然我可以到达我想要的页面),而我gem prawn -这个只适用于写pdf (我只能创建空的pdf文件)。
发布于 2012-12-14 21:42:59
它就在这里:Statically compile pdftk for Heroku. Need to split PDF into single page files
尝试如下所示:
require 'prawn'
Prawn::Document.generate('new.pdf') do |pdf|
pdf.start_new_page(:template => "input.pdf", :template_page => 5)
end发布于 2012-12-14 21:05:39
不知道你是在什么系统上,但是在我的ubuntu12.04机器上,pdftk程序工作了:
pdftk A=your_beautiful.pdf cat A3 output page3.pdf因此,您可以使用反引号来完成此操作,并阅读http://www.linuxjournal.com/content/tech-tip-extract-pages-pdf
https://stackoverflow.com/questions/13878664
复制相似问题