I was curious if anyone else has had problems with RFPDF not doing
word wrapping for rendered HTML?
Early on when I was learning to use RFPDF, I made a sample PDF that
used the write_html method to do some simple output. I noticed then
some strange absence of functionality, where sometimes some HTML I
entered would not produce the same output in the PDF as it would in a
normal HTML document. Namely, the rows were much bigger than they
should be, as if I provided a cell padding, which I didn't.
Now I'm using Edwin Moss' ActiveScaffold fork on GitHub which includes
ActiveScaffoldTools. AST will take the data from the scaffold view and
generate an RHTML document, building its tables using HTML, and send
it to RFPDF. The HTML here at least produced somewhat expected output
(no cell padding), but there's no word wrapping! By standard, <TR>
word wraps unless "nowrap" is provided as an attribute, which it is
not. All rows in the table span only one line of text. I feel like I
can't blame AST here, I looked at the code and the table is generated
using only HTML and ruby tags to insert data. No reason why it
shouldn't word wrap, since that is what <TABLE>,<TR> and <TD> do in
HTML. Any clues?
I might also add the model I wrote my app after, DRY Scaffold (http://
dry.4thebusiness.com/companies) will only let you enter in so many
characters for each field, so when the PDF is generated, it prevents
any line of text to ever reach or surpass the width of the cell. Kind
of sounds like they had trouble with word wrapping too...
Environment:
- Ruby 1.8.6
- Rails 2.1.0
- Edwin Moss' ActiveScaffold v1.1.1 fork (includes AST)
- lastest relase of RFPDF on GitHub, with TCPDF version 1.53.0.TC031
Thanks in advance