Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Does the Adobe Reader IE addon have an interface for saving the file (E.g. IPersistFile)

Guest
Dec 04, 2016 Dec 04, 2016

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?

202
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation