How do you generate the PDF - is it a link? Are you referring the PDF generation activity in a " Link" control with ‘Harness’ action? If so try in Action Set of Link control add the action ‘Open URL in Window’ with the check box ‘Use Page’ as checked and refer the activity in ‘Activity’ field:
String s = tools.getParamValue("Data").toString(); //Data is the base64 encoded string (Parameter)
byte[] byteArray = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(s);
tools.putParamValue("Data",byteArray);
tools.sendFile(byteArray, "Example.pdf",false, null, false);
This will view pdf in a new window.
if you want to download the file
Step 1: Java
String s = tools.getParamValue("Data").toString();
byte[] byteArray = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(s);
tools.putParamValue("Data",byteArray);
There were some additional steps related to setting section rules and adding your base64 string to some property that you will refer in section rule as mentioned above.
Use HTMLToPDF activity to convert this section rule into a pdf.
Can you lease test using the solution that was provided in the documented which was uploaded by @sandeep.kar07 in the above post?
When i run activity standalone Pdf getting downloaded. But my scenarios is when i click on button PDF should open in new window which is not happening now.
Could you please elaborate more on below
How do you generate the PDF - is it a link?
Are you referring the PDF generation activity in a " Link" control with ‘Harness’ action?