Hello Javier,
I hope you read this. Unfortunately, your example at https://blog.xojo.com/2022/05/31/how-to-download-and-preview-pdfs-in-xojo-web-apps/ does not work for me.
My experiment conditions:
Xojo 3.2 Windows
Web App Development
Firefox 102.5.0esr
Acrobat is set up in Firefox as a program for displaying PDF’s.
hapr_PDFWebFile = New Webfile
If( hapr_PDFWebFile <> Nil ) Then
//
// that’s the magic…
// Erlaeutert unter https://blog.xojo.com/2022/05/31/how-to-download-and-preview-pdfs-in-xojo-web-apps/
//
hapr_PDFWebFile.ForceDownload = Falsehapr_PDFWebFile.Data = hapr_PDF.ToData
hapr_PDFWebFile.MIMEType = “application/pdf”
//hapr_PDFWebFile.Filename = hapr_TempDatei.Name
//hapr_PDFWebFile.ForceDownload = True
//Call hapr_PDFWebFile.Download
//hapr_PDFWebFile.ForceDownload = False
//
// Der letzte Schritt beim Aufruf ist nun nur noch …
// z.B. HTMLViewer.LoadURL( hapr_PDFWebFile.URL )/
//
End If
Already in the line ‘hapr_PDFWebFile.MIMEType = “application/pdf”’ the download is done by the browser and the display in Acrobat. If I activate the rest of the code a second download takes place. So that afterwards two equal PDF’S are displayed in Acrobat. In the HTML Viewer, however, it is not displayed at all.
But actually I want to prevent that anything is displayed in Acrobat at all. I only want it to be displayed in my Web App in the HTML Viewer. Do you see a chance there?
Best regards
Ralf