Skip to content

column_box with indent_paragraphs issue #391

Closed
agnessa opened this Issue Aug 21, 2012 · 3 comments

3 participants

@agnessa
agnessa commented Aug 21, 2012

The problem affects both 0.12.0 and 1.0.0.rc1, albeit the outcome is quite different. Basically, when used within a column box like so:

Prawn::Document.generate("foo_indents.pdf",:page_size => 'A4') do
  records = File.read(Rails.root.join("lib/assets/lorem_ipsum_paragraphs.txt")).split("\n").
  column_box([0, cursor], :columns => 3, :width => bounds.width) do
    records.each { |r| text r, :indent_paragraphs => 20 }
  end
end

the indentation works correctly only in the first column.

0.12.0 -- successive columns have progressively smaller indents
1.0.0.rc1 -- second column has no indent and third column has a hanging indent

@jordanbyron

This might be fixed. Here is my test:

data = ["foo " * 40] * 31
pdf = Prawn::Document.new

pdf.column_box([0, pdf.cursor], :columns => 3, :width => pdf.bounds.width) do
  data.each { |r| pdf.text r, :indent_paragraphs => 20 }
end

Result:

Screen Shot 2013-03-08 at 2 02 38 PM

@bradediger
prawnpdf member

Thanks @jordanbyron. @agnessa, please let us know if you still have this issue after trying this out on the master branch.

-be

@bradediger bradediger closed this Mar 8, 2013
@agnessa
agnessa commented Mar 8, 2013

Just verified - works fine, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.