Support Article
HtmlToPdf converts to PDF with extra line spaces
SA-18351
Summary
After upgrading from PRPC 6.3 SP1 to Pega 7.1.7, users reported that PDF documents were being generated with an additional blank line between each line.
Error Messages
Not Applicable
Steps to Reproduce
Write a wrapper activity to call the HTMLToPDF activity, as shown in the following screens.Root Cause
In this case, the source HTML contained a single line, where the majority of the body of the HTML was contained in a <pre> tag with <br> tags being used to add a new line.
Prior to the generation of the PDF document, the HTML was first being run through the class org.w3c.tidy.Tidy to neatly lay out the contents of the HTML.
PRPC 6.3 SP1 used Tidy 1.6; this would generate an additional new line for each <br> it encountered.
Pega 7.1.7 includes JTidy r938. When this was used to parse the HTML, two additional lines were inserted for each <br>.
Resolution
For Pega 7.1.7 the call to tidy the HTML can be turned off by setting the following parameter value to "true":
pyHTMLDisableProcessing
Then, because the main body of the HTML was contained within a <pre> block, the following style was added to effectively double-space each line:
<html><head><style type=\"text/css\"> pre {line-height:200% } </style><meta http-equiv=…
Published February 9, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.