I have a pdf file. I want to rotate all of its pages 90 degrees to the right. How can I achieve this using Prawn gem? When I try to use an existing pdf as a template and try rotate on it, it does not work. I tried the following in vain.
require 'prawn/core'
require 'prawn/layout'
require 'prawn/measurement_extensions'
pdf = Prawn::Document.new(:page_size => [4.in, 6.in], :template => 'orig.pdf', :layout => 'potrait') do |p|
p.rotate(90)
end
pdf.render_file("./test1.pdf")
pdf = Prawn::Document.new(:page_size => [4.in, 6.in], :template => 'orig.pdf', :layout => 'potrait', :rotate => 90)
pdf.render_file("./test2.pdf")
use :page_layout instead of layout... for mote info please follow this tutorial http://prawn.majesticseacreature.com/docs/0.11.1/Prawn/Document.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With