[reportlab-users] Ok to ask a simple z3c.rml question?

Robin Becker robin at reportlab.com
Mon Mar 10 11:48:32 EDT 2008


Werner Thie wrote:

> Hi

>

> Just stumbled over the z3c.rml package and tried to produce some PDFs on

> MSWindows/Python25. Funny enough that all the produced PDFs do not

> contain 0x0d 0x0a lien terminating sequences but 0x0d 0x0d 0x0a which

> sends Acrobat Reader into Neverland. When exchanging the produced

> patterns with correct line terminating sequences 0x0d 0x0a, the docs

> rendered diff ok to the expected ones, or in other words - they are

> correct and show up ok in Acrobat.

>

> Is there a simple explanation for this behavior or should I have

> configured something before running test code?

>

> Thxs, Werner Thie

.......
Unfortunately that sounds like a bug in z3c.rml. When reportlab runs the eol
character is supposed to be LINEEND = '\015\012'; and that should be preserved
as PDF is not a text format. I suspect something is writing the files in the
wrong mode ie text. They should always be written in binary. Since 0x0a is '\n'
and python converts '\n' --> '\r\n' for text files that would seem to make
'\r\n' become '\r\r\n' ie what you observe.
--
Robin Becker


More information about the reportlab-users mailing list