pdf kit with ruby code enbedded

64 views Asked by At

I need to create a pdf from an html template but I need a way to execute some ruby code embedded in it. Maybe this solution could work for me http://iparamtech.blogspot.it/2011/09/generate-pdf-using-erb-or-haml-and.html?m=1 In this way before the template variable is pasted to the pdfkit new method all his variable are valorized and che ruby code in my erb file execute? I need also a way to pass one Id parameter to my erb file. I think to use session variable. Is this a good idea or is there a better solution? Thanks

1

There are 1 answers

0
Guido On

It is not clear what you want. Anyway, use Prawn if you want control over how you create the PDF. But it is NOT a HTML2PDF gem.

https://github.com/prawnpdf/prawn