Spedge
Spedge

Reputation: 1677

Viewing a EmbeddedResource PDF in VB.NET

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.

Upvotes: 0

Views: 712

Answers (1)

Serge Wautier
Serge Wautier

Reputation: 21878

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 ;-)

Upvotes: 1

Related Questions