Question5Replies4004Views×Close popoverAmit Kumar (AmitK211) Cognizant Technology Solutions Cognizant Technology Solutions IN View Profile AmitK211 Member since 2014 25 posts Cognizant Technology Solutions Posted: January 24, 2016Last activity: January 27, 2016Posted: 24 Jan 2016 22:58 ESTLast activity: 27 Jan 2016 7:40 EST Closed Forcing PDF DownloadHi,I Generate PDF using HTML to PDF and the use public API tools.sendFile to send it to browser. tools.sendFile(byteArray,lFileName,false,null,true);When this PDF goes to browser and pdf viewer plugin is installed, PDF opens by default in viewer. Is there any way, we can force download of the PDF instead of opening in viewer.Regards,Amit Pega Customer Service User Experience Low-Code App Development ×Close popoverFacebookTwitterLinkedinEmail Copy Link Copied! Moderation Team has archived post This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question. Posted: 4 years agoPosted: 25 Jan 2016 0:17 EST×Close popoverPhani Sahukaru (sahup1) PEGA Associate Architect - Financial Services Pegasystems Inc. IN View Profilesahup1 PEGA replied to AmitK211Hi Amit, Good morning!could you please try a customized version of @baseclass.downloadFile configured with onClick event 'Open URL in new window' ... or refer OOTB function doAttachmentSingleClick in harness rule... which is referred in Case Management mini gadget to download attached files. Please share your observations, Thank you!psahukaru Posted: 4 years agoPosted: 25 Jan 2016 2:07 EST×Close popoverAmit Kumar (AmitK211) Cognizant Technology Solutions Cognizant Technology Solutions IN View ProfileAmitK211 Cognizant Technology Solutions replied to sahup1Hi Phani Sahukaru@baseclass.downloadFile uses pega_rules_default.downloadFile function which expects a filepath as parameter. But I have bytearray with me, output of HTMLtoPDF Activity. Posted: 4 years agoPosted: 25 Jan 2016 2:22 EST×Close popoverHabeeb Baig (HabeebBaig) PEGA Technical Solutions Engineer Pegasystems Inc. IN View ProfileHabeebBaig PEGA replied to AmitK211Hi Amit,You can use 'always ask' option on your browser which will prompt a window asking you to open/save document.Thanks,Habeeb Baig Posted: 4 years agoPosted: 25 Jan 2016 8:13 EST×Close popoverJohn Pritchard-Williams (JOHNPW_GCS) PEGA Client Support Team Lead PEG GB View ProfileJOHNPW_GCS PEGA replied to AmitK211Hi Amit,I believe this is more likely due to your browser settings than the HTTP Headers on the PRPC side.....but it *might* be you have to ensure the 'content-dispostion' header is set to 'attachment'.Can you try using the OOTB Activity 'Code-Pega-PDF.VIEW' (which I think will set this 'content-disposition' header automatically) instead of using the Java Step 'sendFile' directly....Thanks !John Posted: 4 years agoPosted: 27 Jan 2016 7:40 EST×Close popoverARULDEVAN T.T (Devan) Virtusa Virtusa IN View ProfileDevan Virtusa replied to AmitK211Hi Amit,Could you please use the function sendFile(String, String, boolean, String, String, boolean, StringMap, boolean).I have used this and the PDF got downloaded instead of opening in a window.Thanks.