Skip to content

wearefine/pdf-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FINE's PDF Generator Prototype

Welcome to the world famous PDF Generator Prototype. Here we're testing different Ruby gems functionality and features.

Gems Tested

Wicked PDF uses the shell utility wkhtmltopdf to serve a PDF file to a user from HTML. In other words, rather than dealing with a PDF generation DSL of some sort, you simply write an HTML view as you would normally, then let Wicked take care of the hard stuff.

Notes

Any machine producing PDFs with wicked_pdf (or PDFkit) will need the wkhtmltopdf shell utility. Installing it locally is fairly straight forward. I downloaded the 0.9.9 OS X binary moved and renamed it to /usr/local/bin/wkhtmltopdf, then updated permissions to execute it.

cd /usr/local/bin
sudo chown root wkhtmltopdf
sudo chmod 755 wkhtmltopdf

For wicked_pdf to read assets from the asset pipeline I had to add an initializer that modified wicked_pdfs helper methods. Find it at initializers/wicked_pdf.rb.

Similar to wicked_pdf, only it uses a middleware to render any page with "PDF" format as a PDF.

Generates PDFs with Ruby objects. Styles defined with Prawn classes.

Releases

No releases published

Packages