Not sure if i completely understand your requirement. htmptopdf will generate a byte array and isn't that the byte array something you can use to send to api etc?
//Get the PDF generation utility class
//BUG- 32651 Back-Ported HFix-2932
//Get the PDF bytes.
byte byteArray = pdfUtil.generatePDF(HTMLStream,tools.getParameterPage());
if (byteArray == null || byteArray.length == 0)
oLog.error("PDFUtils did not return any content for HTMLtoPDF");
//Put the byte array in a parameter
what I understood from this code is the final outcome in PDFDocument is still a byte array .
If not can you please make me understand what the first line of code i.e. byte byteArray = pdfUtil.generatePDF(HTMLStream,tools.getParameterPage()); is doing.
also this code is not getting compiled
Java at step: 4 line: 6
HTMLStream cannot be resolved to a variable
Posted: 4 years ago
Posted: 16 Jul 2018 6:45 EDT
Prathap Reddy (PR................)
What do you need? A binary stream (something that is derived from java.io.InputStream)?
In that case, you wrap the result from pdfUtil.generatePDF() into an instance of java.io.ByteArrayInputStream.
Pega usually stores binary data in Strings, and as binary data may contain binary values that are not allowed inside a String, you cannot use new String() with the result from pdfUtil.generatePDF() as argument; instead you need to convert that output into BASE64 first; for that conversion you have several options. The outcome is now a Java String that can be put to text properties on the Clipboard.
So please check what you really needs; what type the target property has, or what type is requested on the signature of the function you want to use.