When 'pre' tags are used in the document, line breaks need to be replaced as 'br' tags before export in order to preserve formatting.

I've tried to come up with a preg_replace pattern for it, but its a bit tough. All my exports that have 'pre' tags end up as a soup of words, as all lines are concatenated together within the pre tags with no line breaks.

Here is a link to a page that when converted to PDF demonstrates this problem:
http://jnetpcap.com/node/135

(Module version number is 1.5 on D6 install)

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

See my comment #3 in #439314: PDF output is almost empty.. The (wrong) pattern you used was replacing all the <pre> patterns in your pages.

The best solution (for now) is for you to download the latest dev which includes the correct fix for that problem.

João

voytechs’s picture

I tried the latest dev and the book it generates is empty, which is what that expression patch was addressing. I tried it on userguide which generates something on the order of 100Kb with 1.5 and the expression patch, where the dev version generates one with 2.5kb in it. It only contains the headers and footer.

http://jnetpcap.com/userguide

I'll leave the dev module in place for a couple of days, as this is not a critical feature of the website to let you test it. Let me know if you want to me to test out a new dev update or even if you want the book db table so you can do your own testing with the text. I use the pre html tags

[pre name=code class=java:nogutter:nocontrols]
[/pre]

a lot on this website. As well as [code][/code] tags as well. (replace [ with angle brackets).

PS: sorry for the late response, I have been extremely busy with that project.

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for the link.. I will try to understand what's going on.

jcnventura’s picture

Status: Active » Closed (fixed)

Hi,

I have determined that the problem is in TCPDF.. Simply put, your file is too large (it's about 140Kb) when sending to TCPDF, and TCPDF was only able to produce contents from your file upto 93Kb.

If you have your own server, try to use the new wkhtmltopdf engine, which is able to generate the PDF correctly.

João