[Gambas-user] Example for download and print in gb.web/gb.web.form

T Lee Davidson t.lee.davidson at gmail.com
Sat Apr 18 00:04:03 CEST 2020


On 4/17/20 3:12 PM, Safiur Rahman wrote:
> Thank you very much
> Can you provide an example of forcing a file to download. I couldn't do it.

Perhaps:
http://gambaswiki.org/wiki/comp/gb.web.form/webform/download

If you truly wish to convert the HTML to a PDF file, you will need to use an external program such as html2pdf (or html2ps -> 
ps2pdf), htmldoc, wkhtmltopdf, etc. as has already been mentioned. If none of these are installed on the server, you will of 
course need authority to install them.

You will also need to capture the form's HTML content. I have not tried it, but maybe something like this would work:

Dim myHtml as String

Output To myHtml
WebForm.Render()
Output To Default


Then Shell out to your preferred PDF converter utility to create the PDF file, and trigger the download with WebForm.Download.


-- 
Lee


More information about the User mailing list