2017-10-27 13 views
1

海老のヘッダと、次のページの重複に流れますスパン内のテキストは、次のページに流れ、ヘッダと重複するが、IユーザーBOUNDING_BOX場合、その中のテキストがbounding_bカーソルで開始されますoxは、テキストが次のページに流れるときから始まります。ここでテキストは、私は、PDFを生成するPrawn.rbを使用し、一つの問題にこだわって

は私のヘッダーです:

repeat(:all) do 
     transparent(0.5) do 
     bounding_box [bounds.left, bounds.top], :width => 
     bounds.width do 
      image "#{Rails.root}/app/assets/images/logo-of- 
      nextcode.png", height: 20 
      move_down 2 
      stroke_horizontal_rule 
     end 
     bounding_box [bounds.left, bounds.bottom + 50], :width => bounds.width do 
      text_box 'PRIVATE & CONFIDENTIAL', align: :center, valign: :bottom, size: 10 
     end 
     end 

そして、ここです、長いテキスト:

span(bounds.width) do 
     object.actions.each_with_index do |a, i| 
     text "#{i + 1}. Description: #{a.message}" 
     text_box "Expected Completion Date: #{a.expected_completion_time&.strftime('%F')}", at: [0, cursor] 
     move_down 15 
     text_box "Actual Completion Date: #{a.actual_completion_time&.strftime('%F')}", at: [0, cursor] 
     move_down 20 
     end 
end 

私の質問は:使用スパンとどのようにあれば、ヘッダとの重複を回避する方法使用する場合は、ヘッダーとテキストの間に大きな空行を避けるbounding_box

答えて

0

canvas

repeat(:all) do 
     canvas do 
     transparent(0.5) do 
     bounding_box [bounds.left, bounds.top], :width => 
     bounds.width do 
      image "#{Rails.root}/app/assets/images/logo-of- 
      nextcode.png", height: 20 
      move_down 2 
      stroke_horizontal_rule 
     end 
     bounding_box [bounds.left, bounds.bottom + 50], :width => bounds.width do 
     text_box 'PRIVATE & CONFIDENTIAL', align: :center, valign: :bottom, size: 10 
    end 
    end 
end 
にあなたのヘッダーを置くようにしてください
関連する問題