prawnpdf/prawn

Does create_stamp change the bounding box right padding?

afdev82 opened this issue · 3 comments

Hi, I'm not sure what's happening here.
I just found that if I execute the following code, the text inside the bounding box it doesn't flow completely to the right like in the manual at page 37:

prawn_document do |pdf|
  pdf.create_stamp('watermark') do
    pdf.transparent(0.5) do
    pdf.fill_color 'cc0000'
    pdf.text_box '[TEST VERSION]',
                 size: 46,
                 width: pdf.bounds.width,
                 height: pdf.bounds.height,
                 align: :center,
                 valign: :center,
                 at: [0, pdf.bounds.height],
                 rotate: 45,
                 rotate_around: :center
    end
  end

  pdf.bounding_box([0, pdf.cursor], width: 200, height: 150) do
    pdf.transparent(0.5) { pdf.stroke_bounds }
    pdf.text 'This text will flow along this bounding box we created for it. ' * 5
  end
end

If I create the stamp after the bounding box, the text in the bounding box breaks like in the manual.
I found it while working with the text boxes, the text was always breaking before the end of the box.

Do you see this issue with master branch?

No, with the master branch is fine!
Could we have a new version with the fix please? Thank you!

Yes, eventually.


I'll close this issue now since it has been resolved and waiting to be released.