prawn_document Arguments:

The prawn_document function can take an optional hash of arguments. These arguments will be passed to the constructor of the Prawn::Document object when it is created.

For example:

app/views/demos/arguments.pdf.prawn:

prawn_document(:page_layout => :landscape, :page_size => "LEGAL") do |pdf|
  pdf.text "Look! I'm landscape"
  pdf.text "And on legal paper too!"
end
Download PDF

Note: there is one exception to this. See Overriding the Rendering Class

Back To Index