Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I wouldn't say implementing an asynchronus pluggable protocol is a hack. It is the standard approach on Windows to implement a new protocol that IE will be able to use. The registering of the protocol handler does require fiddly setup though.</p> <p>But the simplest/easiest way is to actually use a temporary file, and simply link to it from your html. It's not a hassle providing you take care to use the relevant .NET functions to ensure your code doesn't make assumptions about folder/file paths etc.</p> <ol> <li>Use <a href="http://msdn.microsoft.com/en-us/library/system.io.path.gettemppath%28v=VS.100%29.aspx" rel="nofollow noreferrer">GetTempPath()</a> to get the temp folder.</li> <li>Create a pdf file in the temp folder with a unique name using <a href="http://msdn.microsoft.com/en-us/library/system.guid.newguid%28v=VS.100%29.aspx" rel="nofollow noreferrer">Guid.NewGuid()</a></li> <li>Write your binary PDF data to the file.</li> <li>Update the html elements href or src attribute to point the full path of the temp file.</li> <li>Load the html into the WebBrowser control.</li> <li>Delete the temporary pdf file when no longer needed.</li> </ol> <p>Another possible approach would be to Base64 encode your binary data and store it inside a DIV/Input element. Next add an ActiveX control or some other client side broswer component to your html page that knows how to look for the Base64 data and can turn it back into a binary stream (and display as a PDF). I'm not aware of a 3d party control that does this however.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload