Displaying a PDF using REST
User needs to know how to display a PDF in base64 from a REST connector to a user.
Steps to Reproduce
Run a Connect-REST that returns a base64 PDF.
The REST connector itself will not display the PDF. Rather, you must use an activity to take the data the REST connector provides and display it as a PDF.
Perform the following local-change, which works for any binary file that is base-64 encoded.:
1. Map the response in the REST Connector to a Pega property. If the response is base64, the property should be of type Text.
2. Create a new activity. Configure the activity to display the incoming PDF in the browser. Note, if this activity is in a different class than the Connect-REST rule or the properties the response is mapped to, you will have to configure the Pages & Classes tab and choose the appropriate step page on all steps other than Step 4 (which is always a blank step page).
//Convert the base64 PDF to a byte array
//Get the pdf name from the parameter page
//Send the PDF File back to the user.
8. When the activity is run, it will download the PDF from the REST connector and send it to the browser.
By default this will display it in the browser, although browsers can override this to download it instead.
75% found this useful