我想在每一页上放一张图片作为背景。这是我的代码:
Prawn::Document.generate("#{Rails.root.to_s}/public/#{filename}.pdf", :page_size => [576,576], :left_margin => 50,:right_margin => 50, :page_layout => :portrait, :skip_page_creation => true, :skip_encoding => true ) do |pdf|
pdf.repeat :all do
pdf.image open(APP_CONFIG['site_url']+"/images/pdf/bg_blank_high.jpg"), :at => [-pdf.bounds.absolute_left, pdf.bounds.absolute_top], :width => 576, :height => 576
end
pdf.start_new_page(:margin => [75,50,50,50])
pdf.fill_color "8c8464"
pdf.text story.contents, :size => 12, :align => :left, :leading => 3
end
问题是 - 图像会覆盖所有页面中的文本。
有没有办法在图像上放置文字或使图像“发送回”或任何其他想法?