View pdf from webapp

I think I’m loosing the plot somewhere but for the life of me I cant figure this out!

I have a webapp running on a Linux server and there are a number of PDFs stored on the drive all I want to do is load then into an html viewer when the respective button is pressed,

I can create a pdf from scratch using the graphics object and load it to html via webfile but for the life of me I cant seem to figure out how to do the same with an file already created

any help will be appreciated

thanks

WebFile.Open accepts a FolderItem so that you can offer a file on disk to a visitor.

Hi Tim
Thanks for the swift reply. i’m trying

f=specialFolder.ApplicationData.child("myappname").child("myfolder").Child("my.pdf")
session.wf = WebFile.open(f)
HTMLViewer.LoadURL(session.wf.URL)

but I get a download not the file loaded to the htmlviewer

What is the value of the WebFile.ForceDownload property before you try LoadURL?

got it working Thanks again for your help

f=specialFolder.ApplicationData.child(“myapp”).child(“myfolder”).Child(“my.pdf”)
session.wf = WebFile.open(f)
session.wf.MIMEType=“application/pdf”
session.wf.ForceDownload=False
htmlviewer.LoadURL(session.wf.URL)