Web 2.0 and PDFDocument

Hi,

Does anyone know if you can create PDFs (via Xojo’s new PDFDocument feature) with Web 2.0?

Also, how would one give the PDF to the user once it’s created? (With desktop apps, one would provide the user with a SaveAs dialog and then they could save it to their machine.) However, with the web, how do we get a “download” dialog box to happen, so they can save it?

Insights, suggestions?

Thank you much. :slight_smile:

WebFile is your friend.

1 Like

PDFDocument class works on Web targets.
If you need more, you can always use a plugin.
From our Letter web example project:

webfile = new WebFile
webfile.Data = pdf.GetBuffer
webfile.Filename = "letter.pdf"
webfile.ForceDownload = true
			
showurl webfile.URL

where webfile is a property in the webpage.

2 Likes

Hi @Byron_Minick,

You can find an example about how to do exactly that (even displaying it in the browser) inside: Xojo > Example Projects > PDF > EE-Web.

2 Likes

Awesome! Thank you; that makes a lot of good sense… :+1:t2: