Implementing an IE plugin for streaming PDF files
-
Friday, December 02, 2011 6:59 PM
Hello support,
The task I am trying to solve is writing a PDF plugin for IE (that means when I browse to a PDF file/stream I should be able to access that file, download it and display it)
By implementing InitNew of the IPersistStreamInitImpl I was able to access the URL, and than start a custom download process based on that URL, using URLDownloadToFile API from urlmon.dll . Though, sometime I am running into problems especially when the pdf comes as a stream from a database.
Here is the code for getting the URL
STDMETHOD(InitNew)()
{
MessageBox("STDMETHOD(InitNew)", "", MB_OK);
// Obtain moniker from client site and render it to a URL string
LPMONIKER pimkName;
m_spClientSite->GetMoniker(OLEGETMONIKER_FORCEASSIGN, OLEWHICHMK_CONTAINER, &pimkName);
LPBINDCTX pibc;
CreateBindCtx(0, &pibc);
return LoadFromMoniker(pimkName, pibc); // here I get the URL
}
Now my question is :
How can I avoid implementing a separate download mechanism and stream directly the PDF? Is there interface I have to implement? I read about IBindHost and IBindStatusCallback though I didn't find a helpful example for downloading that pdf stream to a file on disk.
Thank you,
Cristian
- Moved by Helen ZhaoModerator Monday, December 05, 2011 3:15 AM (From:Visual C++ General)
All Replies
-
Monday, December 05, 2011 3:13 AMModeratorHi Cristian,
According to your description, I’d like to move this thread to the "Internet Explorer Extension Development" forum for better support where more experts live.
Thanks for your understanding.
Best regards,
Helen Zhao [MSFT]
MSDN Community Support | Feedback to us


