views:

38

answers:

1

Hello,

Yes, this question has been asked before, but I don't feel there's been a good enough answer, or a solution I can relate to.

Leading from this question - Displaying a PDF on a Windows Form, I'd like to display a PDF in a WebBrowser Control, but I'd like the PDF to be an EmbeddedResource.

This question - Describing res protocol - is along the right lines I think, but neither the question nor the answer were voted up, and I could not get the solution to work.

Does anyone have a solution for viewing an EmbeddedResource PDF in a VB.NET Form? Either by following the steps described above with a little more detail - or another, better option?

Thanks.

+1  A: 

FWIW, the res protocol gives access to Win32 native resources.

.NET EmbeddedResource files are not stored as Win32 native resources. Therefore, the res protocol won't help you there.

Why don't your program simply make a temp copy of the PDF file and point the embedded browser to that file?

Edit: The only alternative I can think of is implementing your own Pluggable Protocol. But this is totally overkill and no serious mind would truly consider it ;-)

Serge - appTranslator
Yep, looks like that is the way I will have to go. Is there any way you can think of without streaming it to a temporary copy though?
Spedge
Woarrrgggh @ Edit - I didn't even know that sort of stuff existed. However, it may be a little beyond me as of yet.
Spedge
Serge, although the answer didn't have a huge amount of detail - it pointed me in the right direction.
Spedge