Question
Navy Federal Credit Union
US
Last activity: 4 Oct 2018 11:08 EDT
how to apply styles for PDF
I have a created HTML rule and included section in that, i designed section how i want my should be. I used pyViewAsPDF activity to generatePDF file. PDF files generated but font styles are applied. Please suggest. I tried inline Styles.
**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.
-
Likes (1)
Ramya Cheera -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
HCL
SG
Hi JoelMcLeish,
I tried the same approach as you suggested but still styles are not applied when I open the PDF. Am I missing something here?
I created an HTML rule in which I included the following code to generate the stream.
<pega:include name="Styles" type="Rule-Obj-HTML"/>
<pega:include name="Letter" type="Rule-HTML-Section"/>
Pegasystems Inc.
AU
You'll need to define the styles in the HTML rule as linked css is not rendered by PD4ML.
A slightly roundabout way to get these is to:
- in your skin rule, on advanced tab, tick 'add pega 5 & 6 stylesheets' and save
- open the generated css file
- copy the contents into a new HTML rule (I usually create @baseclass.Styles) between <style></style> tags
- on any HTML rule used to generate PDF's first include that HTML file
You'll need to remember to update the style html rule any time you change the skin.
Navy Federal Credit Union
US
In skin rule I see only 4 tabs mixins, Components, CSS and History. I don't see Advanced tab . I am using 7.1.4
Could you please be more in detail about the same.
Pegasystems Inc.
AU
Whoops, by the advanced tab I mean, the CSS tab, advanced section.
In ML4 the tick box may be called auto-generate or similar (it's basically the only option in advanced.)
Navy Federal Credit Union
US
Yeah i see one option Advanced tab, "Enable Automatic generation" link, by clicking on it I see css/workform_pyenduser71 file name. but there is no such css file created in the application.
Navy Federal Credit Union
US
could you please send that CSS sheet if you have availability.
Pegasystems Inc.
AU
ML4 will be on Ui-Kit2 so there will be a difference in styling.
You need to save the skin rule, and rather than search for the css, just click on the magnifier(was it a gear in 4?) to get through to the generated rule.
Navy Federal Credit Union
US
Hey, I can see it 7.1.7, and CSS file is also generated, I created one Rule-Obj-HTML rule and copied wholes css into that with <style> </style> tags and included this as below. and i can see the whole css is copied into Markup that send to pyViewAsPDF activity. still styles are not applied. do I need to write my own HTML rule instead of section?? and define inline styles for each field??
<pega:include name="Styles" type="Rule-Obj-HTML"/>
<pega:include name="Letter" type="Rule-HTML-Section"/>
Pegasystems Inc.
IN
would it be convincing to attempt adding inline style to a smart layout passing it for PDF generation? please share your thoughts/observations, Thank you!
Accepted Solution
HCL
SG
Hi JoelMcLeish,
I tried the same approach as you suggested but still styles are not applied when I open the PDF. Am I missing something here?
I created an HTML rule in which I included the following code to generate the stream.
<pega:include name="Styles" type="Rule-Obj-HTML"/>
<pega:include name="Letter" type="Rule-HTML-Section"/>
Navy Federal Credit Union
US
I got the answer, no responses pls
Hey, I can see it 7.1.7, and CSS file is also generated, I created one Rule-Obj-HTML rule and copied wholes css into that with <style> </style> tags and included this as below. and i can see the whole css is copied into Markup that send to pyViewAsPDF activity. still styles are not applied. do I need to write my own HTML rule instead of section?? and define inline styles for each field??
<pega:include name="Styles" type="Rule-Obj-HTML"/>
<pega:include name="Letter" type="Rule-HTML-Section"/>
Tata Consultancy Services
US
Hi All,
We have a similar requirement where, in the generated pdf Skin rule/style is not applied(Pega Version 7.2.1). Do we have any workaround/fix for the same?
Thanks.
Pegasystems Inc.
IN
Hi,
Thank you for posting your query in the PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s available on the top right pane of this page. Once created, please reply back here with the URL of the new post.
You may also refer this discussion link as a reference in the new thread.