9

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")
dknight
  • 1,243
  • 10
  • 23

1 Answers1

2

use :page_layout instead of layout... for mote info please follow this tutorial http://prawn.majesticseacreature.com/docs/0.11.1/Prawn/Document.html

HarsHarI
  • 901
  • 4
  • 11