How to change orientation vertical to horizontal in PDF with Prawnto_2 Rails 4 -
i use prawnto_2 gem generate pdf file in rails 4. in controller, send params render in pdf file.
my gemfile have:
#some gems gem "prawnto_2", :require => "prawnto"
so, in views folder have file extension .pdf.prawn
an example of code use is:
class pdffilescontroller < applicationcontroller def user_car_pdf @users = user.all @car = user.find(params[:id]).car end #in user_car_pdf.pdf.prawn text "user's car - #{@car.id.to_s.rjust(5, '0')}", :align => :center move_down 3 @users.each |data| text "#{data.name}# / #{data.email}" text "#{data.description}" end
but, have enormous table information. so, vertical orientation not option, need change orientation.
how can that? have researched , can not find solution.
thanks in advance.
:page_layout => :landscape according prawnto_2 gem documentation class pdffilescontroller < applicationcontroller prawnto :prawn => { :page_size => 'a4', :page_layout => :landscape } end
Comments
Post a Comment