Question


Infosys Limited
US
Last activity: 16 Oct 2018 12:03 EDT
OOTB HTMLToPDF generates Off style PDF
We have a requirement to import case information in to a PDF file and store it in a folder location. for that I'm using the OOTB HTMLToPDF activity to convert section HTML to PDF for saving it as a PDF.
When the PDF file is generated all the fields display in a single column, the styles in the HTML are gone.
Can anyone let me know whether there is any other approach i could use or how can i get the same style as in section i have created.
***Updated by Moderator:Marissa to add SR details***
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution


StellarNexus Consulting UG
DE
Hello Lochan!
Work around for the above issue: making use of default css classes by directly defining them in style tag and specifically stating the same where ever required in the stream.
With this work around I was able to print the html stream to pdf as intended


Cognizant Technology Solution
US
There is a smart shape named Create PDF. Use the create PDF smart shape. It takes section name as a parameter. Hence it will give you a better format in the generated PDF file.


Infosys Limited
US
Thanks Arnab. This works fine with case attachment. i need to generate PDF and save to the file location. when the file save to the file location PDF styles go off. Is there a way i could save the attachment to file location without user interaction


Cognizant Technology Solution
US
Ok. I think HTMLToPDF is correct option. You might raise an SR .


Pegasystems Inc.
IN
Hello!
Please let us know if you do log an SR for this and its ID. That way we can track it and follow-up this discussion with the resolution.
Thank you,


Infosys Limited
US
SR-B53727 is raised


Pegasystems Inc.
IN
Hi Midun,
I see that the SR is currently under investigation. We will update the post once a resolution has been agreed upon.
Regards,
Accepted Solution


StellarNexus Consulting UG
DE
Hello Lochan!
Work around for the above issue: making use of default css classes by directly defining them in style tag and specifically stating the same where ever required in the stream.
With this work around I was able to print the html stream to pdf as intended


Commonwealth Bank of Australia
AU
Hi Lochan,
Is there any HFix provided for this issue. I noticed some one raised SR for this.Please let me know if any HFix provided for this.
Thanks,
P.Krishna Chaitanya


Pegasystems Inc.
IN
Hi Krishna,
There was no HFix for this. It was determined to be an enhancement and FDBK-19974 was created. I looked up the status for this and there seems to be no progress. We suggest that you follow up with your Pega Account Executive to drive this forward.
Thanks!


Commonwealth Bank of Australia
AU
Okay .. Thank Lochan..
Regards,
P. Krishna Chaitanya


Pegasystems Inc.
IN
You're welcome :)


BUPA
AU
Hi,
OOTB HTMLToPDF will always loose the stylesheet if the PDF is saved or transferred via sftp or ftp. There is no way to maintain the styelsheet value as the current skin rule is not referred anywhere while creating the PDF. This is a common problem faced so far for this requirement without any solution defined.


Pegasystems Inc.
US
I don't understand this statement.
SFTP/ FTP transfer is just a binary transfer of the bytes of a file. There's no reason to believe these mechanisms would cause any "loss of stylesheet."
HTML-To-PDF does not have full support for the CSS styles that a web browser does, as a PDF is a printable document.
I would agree that it is common to "lose the styles," because many people end up generating a PDF using plain HTML, without any CSS or references to Pega's stylesheets. The solution is to make PDFs out of harnesses, because Harnesses include styles.


NCS Group
SG
Why can't you upgrade your pdf-generation library? It's so frustrated to see all the css get abandoned.


Pegasystems Inc.
US
The CSS is not "getting abandoned" when you use HTML-to-PDF.
Quite often, the HTML that goes into the HTML-to-PDF mechanism lacks any CSS or references to stylesheets, because the application is piping the HTML generated for a Section rule into HTML-to-PDF.
If you were to render the entire Harness including that Section to an HTML stream, and create the PDF out of that, you would see most of the styles being supported, because the Harness defines the style sheets used when the Section is viewed.


NCS Group
SG
Thanks HOULJ,
Glad to know that, however inside the "Create PDF" smartshape, we don't have a field to put harness, right?
The thing is when we try generating the PDF using pyCreatePDF activity, the PDF is either "generated but fail to attach to case", or "attached but left with no content(2kb, totally blank)".


Pegasystems Inc.
US
Right. Unfortunately, the Smartshape does not have the option for harnesses, last time I checked.
What version of Pega are you having these issues on?


NCS Group
SG


Pegasystems Inc.
US
Okay. It has been confirmed to me that 7.3.1 still has the "only using a Section" limitation. Perhaps someone with more experience with including the CSS in the stream will be able to come comment on that.