[RESOLVED] View Pdf file from Resource Or Added File
I'm trying to use a .pdf file I've added to my project but can't figure out how to get it to show using the webbrowser control. Here is what I'm using to call it:
Ok, I've finally got it to work correctly. Only problem is when I compile it now I get a /resources folder with the report.pdf inside and I don't like that, is there a way to embed the pdf inside the exe and still be able to view it using the code above?
You could embed the PDF in the EXE then extract it as a binary stream, copy it to a (temp) folder then read it from that folder. Would that work?
"Ok, my response to that is pending a Google search" - Bucky Katt. "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk. "Before you can 'think outside the box' you need to understand where the box is."
The attached VS2008 project has an PDF resource which is saved to the Debug folder of the project and then loaded into a web browser on the calling form as suggested by SJWhiteley.
If you are using VS2005 then the language extension can be used as a regular function be removing the extension tag.
The PDF is a random file picked from my computer. Please note the code in form close which should be implemented too.