Dowload PDF after creating PDF via plugin
-
Rafael Davila SosaHas successfully completed the online course Introduction1 month ago #55589
Hi,
my team and I were wondering how to download the PDF after creating it from the plugin. We successfully followed the guide in the Knowledgebase till the step where you visualize the PDF in the PDFViewer. Now we were wondering how to download the file. We saw that we had to transform from base64 into URL in order to use the BO from SF downloadFile. We also managed to do this. Our problem is just how to set the url into the input of the BO.
Do you have any tips on how to do this?Thank you!
Lukas HenningerHas successfully completed the online course IntroductionHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)1 month ago #55614::Hi Rafael,
I have created a quick setup to create and automatically download a pdf. (See the overview Picture)
First I create the pdf using SF_PDF. After this I wrote a quick CSBO with the following code:
fnSuccess({ dataUrl: oPayload.type + oPayload.base64 });
This was just a helper to create the DataURL from the base64.
After this I added the shape for the BO downloadFile.
There I used a constant for the file name (feel free to use a variable tho) and dragged in a process output shape. There I selected the BO which creates the dataURL and selected the correct parameter.
If you already have a dataurl inside a variable then you can drag in the variable from the left and connect it there.
Alternativly, If you are just looking for a download and don’t mind manual downloads, the PDFViewer Widget offers a download button as well. This is not an automatic download and the user has to actively click it.
There many ways to create dataUrls and add them to the download, so in case this did not help you out, please share more information about your current process/code.
Kind Regards
Lukas
You must be logged in to reply to this topic.