How to edit or write on existing PDF with Ruby?

前端 未结 7 1151
眼角桃花
眼角桃花 2020-12-01 10:35

I have a couple of PDF template files with complex content and several blank regions/areas in them. I need to be able to write text in those blank regions and save the resul

7条回答
  •  难免孤独
    2020-12-01 11:02

    According to my research, Prawn is one of the free and best gems I found. The template functionality isn't working in later version. The latest version I could find to work with templates is 1.0.0.rc2 - March 1, 2013. Couldn't find any later version which works with templates. So be mindful if you are using later versions than this. Check below thread for more info.

    https://groups.google.com/forum/#!searchin/prawn-ruby/prawn$20templates/prawn-ruby/RYGPImNcR0I/7mxtnrEDHeQJ

    PDFtk is another capable tool for PDF manipulation and to work with templates. But it mentions following points,

    • This library is free for personal use, but requires a license if used in production
    • This is a non-ruby command line tool

    For more information please refer the below link http://adamalbrecht.com/2014/01/31/pre-filling-pdf-form-templates-in-ruby-on-rails-with-pdftk/

提交回复
热议问题