My requirement is I have to convert HTML content to PDF file - Completed
On click of a link in the section, previously Converted PDF document should be directly opened. It should not be saved/attached to the case - Completed
Also it should not be saved to any local machine or repository. This is because the content contains user PII information and for security purpose, the document is not supposed to be downloaded anywhere in the machines folders or in PEGA repository. It should only be opened in browser and closed from the browse.
Is this possible to do in PEGA? Any help on this regard, is highly appreciable.
I don’t think you can disable browse download option in browser pdf preview. You can show content in section using same html code that you used to convert from html to pdf.
First, you need to use the Open URL in Window action on the link click. Then, create an activity where you include the logic to convert HTML to PDF using the HTMLtoPDF activity and to view the PDF using Code-Pega-PDF.View. Normally, when you use both activities, the file will be downloaded automatically. However, with a small change in the View activity’s Java step, you can open the PDF directly in a new browser tab instead. Just change the last parameter of the sendFile method to false.
@Veera J Nidadavolu , Thank you so much for the solution. It worked. however there is one observation which I want to check if even that is possible to be removed.
Onclick of the link, document is directly getting opened in another window for view purpose but at the same time there is a tool bar coming up which has an option to save as shown in the image below. Is it possible to hide that tool bar as well so that user will not have an option to save it to his local machine at all?
@ganginena The toolbar that appears when the PDF is opened in a new browser tab is controlled by the browser’s built-in PDF viewer. Unfortunately, this is not something that can be restricted or hidden from Pega, as the behavior depends on the user’s browser settings and capabilities.
@ganginena Yes, but with limits. Generate the PDF fully in memory (no repository, no case attachment) using pxCreatePDF/HTMLToPDF, keep it on a thread-scoped page, and immediately stream it to the browser with tools.sendFile() (Content-Type application/pdf, Content-Disposition inline). Add no-store, no-cache headers so the browser avoids caching, and never call pxAttachContent or save to any Data-WorkAttach. Expose it through a short-lived, tokenized URL (custom service/stream servlet) that validates the token, returns the in-memory bytes once, then invalidates the token and clears the clipboard page. Show it in a new window or modal via openUrlInWindow so users can view and close it. You cannot truly block download or screenshots in a browser, but you can discourage it: set PDF permissions (print/copy disabled), add a “Confidential” watermark, and log every view. Also set strict security headers (Content-Security-Policy, X-Frame-Options) and disable caching on proxies. This approach meets “view only, not stored” on the Pega side while acknowledging browser limits.