How do you combine PDFs in ruby?

前端 未结 8 2075
你的背包
你的背包 2020-12-25 15:17

This was asked in 2008. Hopefully there\'s a better answer now.

How can you combine PDFs in ruby?

I\'m using the pdf-stamper gem to fill out a form in a PDF.

相关标签:
8条回答
  • 2020-12-25 15:47

    Haven't seen great options in Ruby- I got best results shelling out to pdftk:

    system "pdftk #{file_1} multistamp #{file_2} output #{file_combined}"
    
    0 讨论(0)
  • 2020-12-25 15:48

    Use ghostscript to combine PDFs:

     options = "-q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite"
     system "gs #{options} -sOutputFile=result.pdf file1.pdf file2.pdf"
    
    0 讨论(0)
提交回复
热议问题