reingart / pyfpdf_googlecode

Automatically exported from code.google.com/p/pyfpdf
GNU Lesser General Public License v3.0
0 stars 0 forks source link

pyfpdf html to pdf mis-handles '<', '>', '&' and &apos; in tables. #80

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.The html to pdf routine inserts a new cell when it sees a lt, gt, amp, or 
apos. This causes incorrect PDF output that adds a column to the table when one 
of thes characters is encountered. For example, the following table in HTML

row 1   It's a boy  Wt > 4 kg   len < 40cm
row 2   boy & girl  Wt > 3kg    len < 35 cm
is converted to the following PDF

row 1   It  s a boy Wt
row 2   boy girl    Wt
2.
3.

What is the expected output? What do you see instead?
The HTML produces:
--------------------------------------------------------------------
| row 1       | It's a boy     |  Wt > 4 kg     | len < 40cm       |
|-------------|----------------|----------------|------------------|
| row 2       | boy & girl     |  Wt > 3kg      | len < 35 cm      |
--------------------------------------------------------------------
The PDF produces:
--------------------------------------------------------------------
| row 1       | It             | s a boy        | Wt               |
|-------------|----------------|----------------|------------------|
| row 2       | boy            | girl           | Wt               |
--------------------------------------------------------------------
What version of the product are you using? On what operating system?
2.9 on linux, windows, OSX

Please provide any additional information below.

The essential code is at https://github.com/rjwarg/pyfpdf_hack.git. The README 
has a brief summary.

Original issue reported on code.google.com by rjw...@gmail.com on 17 Nov 2014 at 8:12