Save desired pdf page from pdf file using ruby
我有一个pdf文件。我想将给定的页面(第5页,保存下来)另存为其他pdf文件。我该如何完成呢?
到目前为止,我已经使用过
它在这里:为Heroku静态编译pdftk。需要将PDF拆分为单页文件
尝试类似的方法:
1 2 3 4 5 | require 'prawn' Prawn::Document.generate('new.pdf') do |pdf| pdf.start_new_page(:template =>"input.pdf", :template_page => 5) end |
不知道您使用的是什么系统,但是在我的ubuntu12.04机器上,pdftk程序有效:
1 | pdftk A=your_beautiful.pdf cat A3 output page3.pdf |
因此您可以为此使用反引号,并在http://www.linuxjournal.com/content/tech-tip-extract-pages-pdf
上进行阅读