1
我想布局每页6个图像大虾在Ruby中:虾图像位置
case (idx % 6) # ugly
when 0 : (pdf.start_new_page; pdf.image img, :position => :left, :vposition => :top, :width => 270)
when 1 : pdf.image img, :position => :right, :vposition => :top, :width => 270
when 2 : pdf.image img, :position => :left, :vposition => :center, :width => 270
when 3 : pdf.image img, :position => :right, :vposition => :center, :width => 270
when 4 : pdf.image img, :position => :left, :vposition => :bottom, :width => 270
when 5 : pdf.image img, :position => :right, :vposition => :bottom, :width => 270
end
不知道我在做什么错,但它打印第3个图像到PDF,然后创建一个新的页面和打印的最后三个:
第1页:
<img> <img>
<blank> <blank>
<blank> <blank>
第2页:
<blank> <blank>
<blank> <img>
<img> <img>
任何建议都会有帮助。