PDF generation issue through standard agent
Having hard time to generating PDF through standard agent. PDF with improper alignment, without styles and colors as it generated from backend process (standard agent). If it is generated from front end using create pdf smart shape everything is looking good, but if it is created from agent no styles and colors applied. Please help me out of this.
***Updated by moderator: Lochan to update Categories***
-
Like (0)
-
Accepted Solution

Hi,
Perform below steps and your issue will get resolved.
1) Instead of configuring the Queue method in activity step, configure the queue method in java step with necessary parameters passed.
2) The java step code is as follows:
tools.getParameterPage().putString("pyID", myStepPage.getProperty(".pyID").getStringValue());
tools.getParameterPage().putString("inStandardsMode","true");
final ClipboardPage portal = tools.findPage("pyPortal");
final List otherPages = new ArrayList(){{add(portal);}};
tools.getRequestor().queueBatchActivity("Activity_class_name", "Activity_name",tools.getParameterPage(),null,otherPages,false );
Thanks and Regards,
Prudhvi
Hello
how you are definining the styles in the generated PDF ?
May be this is a good article to check : https://community.pega.com/support/support-articles/pdf-download-not-picking-skin-rule-styles
Earlier it was from the skin and was working fine with Generate PDF shape now we are going for agent and Applied skin rule through the non autogenerated HTML as mentioned in link.
https://community.pega.com/support/support-articles/pdf-download-not-picking-skin-rule-styles
but the result is still same, May i know what am i missing?
Approach followed
<html>
<head>
<pega:static type="style" app="webwb">
<pega:file name="workform_demo.css" />
</pega:static>
</head>
<body>
<%
StringMap sectionListKeys = new HashStringMap();
sectionListKeys .putString("pxObjClass", "Rule-HTML-Section");
sectionListKeys .putString("pyClassName", "Demo-FW-Work");
sectionListKeys .putString("pyStreamName", "SummaryForm");
String sectionStream = tools.getStream(sectionListKeys, null);
out.println(sectionStream);
%>
</body>
</html>
Thanks in advance :-)

Also the following SA seems to align to your use case. Which version are you on it indicates the issue is corrected in 7.1.8?

I am working on 7.2 version. Problem still exists it seems.

Hi,
In the below article, it is mentioned like <pega:file name="ExportToPdfStylesCSS.css" /> but you are using <pega:file name="workform_demo.css" />. May I know the reason why there is conflict here.
Article: https://community.pega.com/support/support-articles/pdf-download-not-picking-skin-rule-styles
Thanks in Advance!

Hi Prudhvi,
Skin rule CSS file is applied in my case.
Hello,
Did you created the custom CSS file at your end and defined the required styles on it? If so, could you please verify if the files are being picked properly or not(by following the steps mentioned by Ganga).
Accepted Solution

Hi,
Perform below steps and your issue will get resolved.
1) Instead of configuring the Queue method in activity step, configure the queue method in java step with necessary parameters passed.
2) The java step code is as follows:
tools.getParameterPage().putString("pyID", myStepPage.getProperty(".pyID").getStringValue());
tools.getParameterPage().putString("inStandardsMode","true");
final ClipboardPage portal = tools.findPage("pyPortal");
final List otherPages = new ArrayList(){{add(portal);}};
tools.getRequestor().queueBatchActivity("Activity_class_name", "Activity_name",tools.getParameterPage(),null,otherPages,false );
Thanks and Regards,
Prudhvi

Hi Prudhvi,
The java code you have provided is working fine. No parameters are required in my case, just changed class and activity.
tools.getParameterPage().putString("pyID", myStepPage.getProperty(".pyID").getStringValue());
tools.getParameterPage().putString("inStandardsMode","true");
final ClipboardPage portal = tools.findPage("pyPortal");
final List otherPages = new ArrayList(){{add(portal);}};
tools.getRequestor().queueBatchActivity("Activity_class_name", "Activity_name",tools.getParameterPage(),null,otherPages,false );
Thank you Prudhvi to get me out of this issue.
Hi Prudhvi,
This has been worked for long time. Unfortunately from last 10 days the same problem we are getting in STG and DEV environment but it is good in UAT. Didn't do any code changes.
PDF is generating from the batch requestor but skin is not applied. Please suggest.

Hi NagaRamu,
Please revert back the Java changes and keep the given code as it is. It will work for your scenario. Please recompile the function in all nodes.
Thanks,
Prudhvi

In the 7.2.2 version still have the same problem, it there any solutions?
Please kindly tell me how to fix it.

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
Thanks!