Hi,
I'm trying to convert a HTML page into pdf, but the issua I xant download the result because I dont see the download widget in the left menu.
is there a solution for this problem please ?
I suggest you take a look at OutSystems File Transfer Plugin that now supports PWA:
https://www.outsystems.com/forge/component-overview/1409/file-transfer-plugin
Cheers,
Rúben
Hello,
Since you're building a PWA, your options are a bit limited. However, here's one way to implement this:
1 - Expose a REST API method in your app that will generate and return the PDF file. Something like this:
Notice that there's a call to the "AddHeader" action from the "HTTPRequestHandler" extension:
2 - In your UI's client action, you'll have to use JavaScript to make a request to your API and download the resulting file:
You have to pass the full URL to the REST API method you created above to the "DocumentURL" input parameter.
Here's the full JavaScript code:
var xhr = new XMLHttpRequest();xhr.open('GET', $parameters.DocumentURL, true);xhr.responseType = 'blob';xhr.onload = function(e) { if (this.status == 200) { var myBlob = this.response; var link = document.createElement('a'); link.href = window.URL.createObjectURL(myBlob); link.download = "Document.pdf"; link.click(); }};xhr.send();
I tested this in a PWA running in iOS and it worked well. I do not have an Android device to test it though.
Hii you asen
Already ans this question kindly refer this link
https://www.outsystems.com/forums/discussion/67663/file-transfer-plugin-does-file-transfer-plugin-works-for-pwa-generated-app/
Thanks