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

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -