我有一个pdf文件.我想将其所有页面向右旋转90度.如何使用Prawn gem实现这一目标?当我尝试使用现有的pdf作为模板并尝试旋转它时,它不起作用.我徒劳地尝试了下面的事情.
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")
Run Code Online (Sandbox Code Playgroud)
使用 :page_layout 而不是布局... 对于节点信息,请按照本教程http://prawn.majesticeacreature.com/docs/0.11.1/Prawn/Document.html
| 归档时间: |
|
| 查看次数: |
1509 次 |
| 最近记录: |