0

I'm working on an Internet Explorer addon (IE11), using C#. I have by BHO & Button registered, and working. I'm trying to get the contents of the current tab when my button is pressed, WITHOUT issuing a second request for the resource.

With HTML, this is easy, I'm just using execScript to run some JavaScript which gets the page HTML.

Preferably, there would be a way to get the current pages content as a binary stream without issuing another request that works for HTML or PDF files (assuming the Adobe reader extension is installed), but I can't find any information about it.

Brandon
  • 16,382
  • 12
  • 55
  • 88
  • the activex document server may support IPersistFile, IPersistStorage or IPersistStream.use IWebBrowser2::get_Document to get the IDispatch interface for the document then query for those interfaces. – Sheng Jiang 蒋晟 Dec 04 '16 at 01:23
  • @ShengJiang蒋晟 IPersistFile.Save works for HTML files but throws a non implemented exception for PDFs. I can't figure out how to get the others working in C# – Brandon Dec 04 '16 at 13:54
  • here's an example for IPersistStorage https://social.msdn.microsoft.com/Forums/vstudio/en-US/bc85ed23-2273-4b33-b862-354b61294968/is-there-any-way-to-open-excel-from-stream-and-save-as-an-excel-document-into-a-stream?forum=vsto – Sheng Jiang 蒋晟 Dec 04 '16 at 15:15
  • I believe I've confirmed that neither IPersistStorage and IPersistStream are implemented, but IPersistFile is (but not the Save method). – Brandon Dec 04 '16 at 20:09
  • Check other IPersist* interfaces mentioned here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms688545%28v=vs.85%29.aspx – Sheng Jiang 蒋晟 Dec 04 '16 at 21:09

0 Answers0