When a web app generates a PDF (that’s different for every user), from what I understand, we have to save the PDF file to the server (temporary folder) first and then pass it on to the user with the WebFile class. However, does the temporary folder automatically dispose of the PDFs after a period of time, or is that something the app will need to handle? (Otherwise, I am thinking that one might end up with thousands of unwanted PDFs on the server after some period of time…)
How would one go about that, as I am only seeing a “save” method for the PDFDocument class as an option? It does provide a string feature, but it says that is formatted in JSON instead. Hmm…
You can use the PDFDocument.ToString method to put the info directly into the Data property of the WebFile. Sorry, you will need to save it to disk first.
Just remember to keep the file around long enough for the user’s browser to access it!