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.
If you want to add any template (created by macOS Pages or Google Docs) using the combine_pdf gem then you can try with this:
final_pdf = CombinePDF.new
company_template = CombinePDF.load(template_file.pdf).pages[0]
pdf = CombinePDF.load (content_file.pdf)
pdf.pages.each {|page| final_pdf << (company_template << page)}
final_pdf.save "final_document.pdf"