Copy link to clipboard
Copied
I'm working on an addon for my company that will add a button to Internet Explorer. When users go to a PDF (using the Adobe PDF addon), they can click this button and I want to access the current PDF and save it to their computer for our software to access (it watches a directory for new files). However, I don't want to issue a second request for this file as that would cause duplication (PDF is generated by a POST action on our web server).
public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdExecOpt, IntPtr pvaIn, IntPtr pvaOut) {
try {
Debug("Exec triggered");
var document = browser.Document as IPersistFile;
if (document == null) {
Debug("Brower.Document was null");
} else {
Debug("Got an IPersistFile from browser.Document");
document.Save(@"D:\TestFile.pdf", false);
Debug("Saved file");
}
} catch (Exception e) {
Fatal($"Uncaught exception {e}");
}
}
This works fine for HTML but not for PDFs, throwing a not implemented exception. Does the Adobe PDF addon implement another interface that I can use to achieve the same result?
Have something to add?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more