I have a requirement that inside a grid for each row i ahve to display a link in a column on click of lick i have to open a pop up in which i ahve to display a pdf file from server location. each row will have a application id and file location ahve pdf with same application id. Ho to achieve this. there is no api for getting file stream.
***Edited by Moderator Marije to add Capability tags***
Now to display the file on click of a link or button. Do the following.
1. Call an activity or data transform to trigger the D_pxGetFile data page.
2. Store the full path of the file in the format data:image/gif;base64,Param.Path. ( Refer attachment)
3. Use a non-auto generated section to display the file.
<p> <pega:reference name=".pyTempText" /> </p>
Note: When you use the get file API, D_pxGetFile, the file content is loaded into memory as a base-64 encoded string. When the size of the file to be read is larger than 45 MB, an exception is thrown and the content is not loaded into memory. You can configure the maximum file size by using the repository/maxFileSizeInMemory dynamic system setting in the Pega-IntegrationEngine ruleset.
Approach 2: If you want to preview & download the PDF, then do the following.
1. After retrieving the base 64, convert it to byte array using function(recommended) or java step.
2. Call Call Code-Pega-PDF.View to view & download the PDF file