Question
Commonwealth Bank Group
IN
Last activity: 6 Dec 2016 4:20 EST
Cant find the PDF that is generated through the HTMLToPDF activity
Hi,
I have created an correspondance rule of type 'Mail' and passed that in the 'MarkUp' input parameter for the OOTB HTMLToPDF activity. When the activity is run(stand alone), runs fine. The success message says 'The operation completed successfully, but no content returned'.
But I am not able to find if the PDF was generated properly and the current location of the PDF.
Note: No errors in the tracer.
Regards,
Rashmi
***Updated by moderator: Lochan to update Categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Commonwealth Bank Group
IN
I solved this issue by using 'Property-Set-HTML' after page new where I set the property to get its value from the Markup parameter. I later tried the same with 'Property-Set-Corr' as I wanted to generate a PDF out of a correspondence rule.
Thanks for all the guidance !!!
Regards,
Rashmi
PEG
IN
Can you check the file in ServiceExport directory of temp folder?
Please refer pyViewAsPDF OOB activity which "Sends the PDF document to the user as a response to the browser"
Commonwealth Bank Group
IN
Hi Gangababu,
Could you please let me know where I should look for 'ServiceExport directory of temp folder' ?
Im not able to find 'pyViewAsPDF' activity as well by search.
Thanks !!!
PEG
IN
Hi,
You could find the temp folder directory from your server. For ex in tomcat, this setting would present in context.xml. Once you find out the directory you can go to below path and search for PDF files if present or not.
<Environment name="url/initialization/explicittempdir" value="<temp_directory>\721oracle" type="java.lang.String>
<temp_directory>\721oracle\StaticContent\global\ServiceExport
Regarding your 2nd query, you can search with old:pyViewAsPDF for the specified rule.
Pegasystems Inc.
GB
Hi Rashmi,
HTMLTOPDF stores the result in memory (In a Java Byte Array): you can use 'Code-Pega-PDF.View' to stream the result back to the browser.
Like this; assume your HTML rule to convert it is in the class 'My-Test-Class', create an Activity like this:
Page-New workpage (My-Test-Class)
Page-New contextpage (Code-Pega-PDF)
Call HTMLTOPDF <your-HTML-Rule, other options> [workpage]
Call View [contextpage]
With 'pass in current parameter page' selected for the call to 'View'.
You'll need to supply (at a minimum); the name of the HTML rule to convert, the name of the resultant PDF document ("test.pdf" etc) [see Param Tab for 'Code-Pega-PDF.View' - and HTMLTOPDF will *create* the Object Param needed for 'View').
Commonwealth Bank Group
IN
Hi Prij,
Thanks for your pointers. I did up until the last instruction. But in the last step u say the
"You'll need to supply (at a minimum); the name of the HTML rule to convert, the name of the resultant PDF document ("test.pdf" etc) [see Param Tab for 'Code-Pega-PDF.View' - and HTMLTOPDF will *create* the Object Param needed for 'View')."
When we pass the current parameter page the additional parameters supplied (the name of the HTML rule to convert, the name of the resultant PDF document ("test.pdf" etc) ) will be ignored. So i did not pass the parameter page. But I get the below error (In the tracer) while I try to run my activity in the contect page of my View activity.
Note: My parameters tab is empty. Please find the screen shot attached for your reference.
** Java Exception: java.lang.ClassCastException: java.lang.String cannot be cast to [B |
Your guidance is really aprreciated. Thanks !!!
Hi Prij,
Thanks for your pointers. I did up until the last instruction. But in the last step u say the
"You'll need to supply (at a minimum); the name of the HTML rule to convert, the name of the resultant PDF document ("test.pdf" etc) [see Param Tab for 'Code-Pega-PDF.View' - and HTMLTOPDF will *create* the Object Param needed for 'View')."
When we pass the current parameter page the additional parameters supplied (the name of the HTML rule to convert, the name of the resultant PDF document ("test.pdf" etc) ) will be ignored. So i did not pass the parameter page. But I get the below error (In the tracer) while I try to run my activity in the contect page of my View activity.
Note: My parameters tab is empty. Please find the screen shot attached for your reference.
** Java Exception: java.lang.ClassCastException: java.lang.String cannot be cast to [B |
Your guidance is really aprreciated. Thanks !!!
** Java Exception: java.lang.ClassCastException: java.lang.String cannot be cast to [B |
Pegasystems Inc.
GB
Take a look at this Support Video: https://community.pega.com/pegatube/support-guide-troubleshooting-cyrillic-script-not-appearing-generated-pdf
It's actually about troubleshooting HTMLTOPDF with regard to Cyrillic characters - but in doing so it references a test Activity which is doing pretty much what you need to do.
If this still doesn't provide enough information - let us know - i'll provide some screenshots showing an example.
Cheers
John
-
Nalina Ravibiruthoji
Pegasystems Inc.
GB
Actually - it looks from your screenshots that you just need to use the 'Pass current Parameter Page' into both HTMLTOPDF and VIEW....
Commonwealth Bank Group
IN
Thanks a lot John, that worked !!!
I passed the parameter page for both the activities. But now, when I pass an HTML stream for a markup parameter, the PDF gets generated but there is no data. It just displays the value I enter for Markup parameter (Taking this value as a litral and not a rule name). Please find the screen shots attached.
Also, can I pass a correspondence of type 'Mail' or a Paragraph for the Markup parameter to generate a PDF document?
Thanks,
Rashmi
Accepted Solution
Commonwealth Bank Group
IN
I solved this issue by using 'Property-Set-HTML' after page new where I set the property to get its value from the Markup parameter. I later tried the same with 'Property-Set-Corr' as I wanted to generate a PDF out of a correspondence rule.
Thanks for all the guidance !!!
Regards,
Rashmi