Hi there,
I'm using Prawnto to generate PDFs in my Rails app. I want three specific options set for my PDFs:
- I don't want it to start with a blank page
- I want it to download directly (not inline)
- I want to specify the filename
Here's my controller method:
def print
@purchase = Purchase.find(params[:id])
prawnto :prawn=>{:skip_page_creation=>true}, :inline=>false, :filename=>@purchase.deal.name + "-" + @purchase.customer.name+".pdf"
end
Without the :skip_page_creation option, the other two options (inline and filename) work fine. But when I add the skip_page_creation option, it goes inline with a default filename. And of course, if I remove skip_page_creation, I get a nice downloaded PDF with a first blank page.
The docs for this library leave something to be desired, but can anyone point me in the right direction?
Cheers!
Aaron.