you have to definitely check out Prawn gem, by which you can generate any custom pdf files. You can actually use prawn to write in text into existing pdfs by treating the existing PDF as a template for your new Prawn document.
For example:
filename = "#{Prawn::DATADIR}/pdfs/multipage_template.pdf"
Prawn::Document.generate("full_template.pdf", :template => filename) do
text "THis content is written on the first page of the template", :align => :center
end
This will write text onto the first page of the old pdf.
See more here:
http://prawn.majesticseacreature.com/manual.pdf
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…