io - Storing pdf as tmp and pointing webbrowser to it -


i bit confused how point webbrowser temporary pdf file.. if point pdf, download box dialog asking me download file , invalid browser page.

webbrowser b = new webbrowser(); documentcontainer.child = b; temporaryfilename = system.io.path.gettempfilename(); system.io.file.writeallbytes(temporaryfilename, this.currentdocument.documentdata); //pdf b.navigate(temporaryfilename); 

i tried write file environment.specialfolder.applicationdata hell of , getting hit error

"file not begin '%pdf'"  webbrowser b = new webbrowser(); documentcontainer.child = b; temporaryfilename = environment.getfolderpath(environment.specialfolder.applicationdata) + this.currentdocument.title+".pdf"; system.io.file.create(temporaryfilename);//pdf b.navigate(temporaryfilename); 

i've done several times other files somereason not want work pdf!

try:

b.navigate("file://" + temporaryfilename); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -