Question
Bank of America
US
Last activity: 30 Jan 2020 14:19 EST
PDF generation not formatting as per CSS
Hi,
Here is the scenario:
- I have created two CSS text file rules. One of these contains the source code of the bootstrap CSS.
- An HTML rule refers to these two text file rules.
- An activity rule that gets invoked from the on-click event of a navigation rule calls the HTMLtoPDF activity and passes the HTML rule's contents as a parameter. It then calls the View activity of Code-Pega-PDF class.
Problem: The generated PDF is not reflecting all of the settings from the bootstrap CSS. Why is this happening?
Note: When we call the Show-HTML method instead of the HTMLtoPDF activity, the output is reflecting all of the settings from the two CSS text file rules.
***Edited by Moderator Marissa to update SR Details***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
TCS
US
Hi Marissa,
I am fine either way.
The support engineer has already indicated that this issue cannot be fixed. He has also confirmed my solution of including images to display specialized icons like plus, minus etc. instead of CSS3 tags that display the same.
As such, this limitation of the tool is no longer a blocker for my team.
Thank you for your support!
Sourav
Bank of America
US
My latest analysis indicates that the issue is because the OOTB PDF generation code does not support flex box settings. For example, when I replace the contents of the HTML rule with the one in the attached file Flex Box for PDF.txt, the issue remains (HTMLtoPDF activity still renders the PDF incorrectly whereas Show-HTML method displays the contents correctly).
Pegasystems Inc.
IN
Hello Sourav,
There is a workaround for this issue:
Enable the DSS setting "Pega-UIEngine: UseCompactStylesforPDF" by setting the value to "true". After you do so, check if the generated PDF shows correctly.
NOTE: HTMLtoPDF activity has been modified to add the stylesheet “pyCompactStylesforPDF” from Pega 7.4 onwards. This stylesheet is an available rule.
TCS
US
Hi,
I changed the DSS and still did not work. However, I have created an SR. I will wait for the support engineer's response.
Thanks!
Sourav
Pegasystems Inc.
US
TCS
US
Hi Marissa,
SR id is SR-D74577.
Thanks!
Sourav
Pegasystems Inc.
US
Thanks @SouravS1559!
TCS
US
Hi Marissa,
As per the support engineer, the above requirement cannot be addressed as of now. Hence, please mark this query as closed.
Thanks!
Sourav
Pegasystems Inc.
US
Hi @SouravS1559,
Thanks for letting me know! We can leave this open for future replies from community members if you would like.
Let me know! :)
Accepted Solution
TCS
US
Hi Marissa,
I am fine either way.
The support engineer has already indicated that this issue cannot be fixed. He has also confirmed my solution of including images to display specialized icons like plus, minus etc. instead of CSS3 tags that display the same.
As such, this limitation of the tool is no longer a blocker for my team.
Thank you for your support!
Sourav
Pegasystems Inc.
US
You're welcome Sourav! I marked your reply as the solution.