Question
Bradesco Seguros
BR
Last activity: 24 Jan 2021 18:16 EST
Convert Base 64 to PDF - Problems
I'm using version 8.5 and I have a requirement where I get the return of a service that responds to a file in base64 and then I have to convert it into a byte, so that it is possible to download the PDF or even attach it to the case.
I am using the function below, but the pdf file is being generated corrupted. The same function in version 7.2.2 works very well.
Can someone help me and indicate what should be done?
String s = tools.getParamValue ("contentStream"). ToString (); // markup is the base64 encoded string byte [] byteArray = new com.pega.pegarules.pub.util.Base64Util (). decodeToByteArray (s); tools.putParamValue ("PDFDocument", byteArray);