How to automate the Acrobat Reader plugin in Internet Explorer

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default How to automate the Acrobat Reader plugin in Internet Explorer

    Hi,

    I have been trying to figure out how to automate the Acrobat Reader plugin in Internet Explorer. My goal is to find a way to allow users of our web application to print PDFs to the default printer without having to go through the plugin's GUI. Our application includes a browser helper component, and I had hoped it would be possible to use the IWebBrowser2 interface's get_Document() method to get at some sort of interface to the plugin (as is possible for, say, a Word document hosted in Internet Explorer) and then use this to print the document. However, this does not work: get_Document(), when called on an IWebBrowser2 instance with a PDF loaded, returns E_NOINTERFACE. I also tried calling the IWebBrowser2 interface's ExecWB() method with OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, and PRINT_DONTBOTHERUSER, and printed a blank page rather than the PDF.

    Is it possible to do what I am attempting? Like I said, my core goal is to print a PDF from within Internet Explorer without requiring user interaction. I'd appreciate any suggestions as to how I might accomplish this -- it doesn't _have_ to be by automating the plugin (maybe that is a the wrong approach... though it sure would be nice if the plugin provided access to its object model via IWebBrowser2->get_Document()).

    Thanks in Advance,

    Steve Mckinney
    Senior Developer
    Paxon Corporation
    Steve_McKinney@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Talking to Internet Explorer embedded Acrobat Reader via COM
      Hi all. I'm developing an Internet Explorer BHO (browser plugin) and was wondering whether it's possibly for me to communicate with Acrobat Reader...
    2. using Win32::OLE to automate Internet Explorer with multiple browsers
      I am using Win32::OLE to automate some Internet Explorer processes for testing. Everything is working great, until the browser launches a popup...
    3. After viewing a .pdf file thru Acrobat Reader, Internet Explorer becomes non responsive.
      We use many .pdf files on our website and after viewing a file the file becomes non responsive, won't let me go back to any site being viewed thru...
    4. Internet Explorer and ADOBE READER
      I want to open my pdf-files with Adobe Reader and n o t with Adobe Professional. What can I do? Reinhard --
    5. Acrobat Professional V6 vs. Acrobat Reader V6 in Internet Explorer
      I have both Acrobat Professioanl v6 and Acrobat Reader v6 on my PC. When I view a PDF via Internet Explorer, Acrobat Professional is launched. I want...
  3. #2

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    The ability to do printing from server side without prompting on the
    client was considered a major security hole, and is now impossible. If
    you find a way, Adobe will fix the bug asap...

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  4. #3

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    I disagree that what I am attempting to to would constitute a major security hole. I am not suggesting that I would like to print without prompting from untrusted javascript code. It would be accomplished via a _trusted_ browser helper component that users _choose_ to install as part of our web application, the same way they choose to install the Acrobat Reader plugin itself, or any other plugin for that matter.
    Steve_McKinney@adobeforums.com Guest

  5. #4

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    You are also using Internet Explorer's API not Acrobat/Readers API. You might try using the AcroPDF.DLL ActiveX controls "printall" method but you will receive a warning dialog unless you set the registry item for the permanent dismissal of that dialog.

    Sabian
    Sabian_Zildjian@adobeforums.com Guest

  6. #5

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    Thanks, I'll take a look at that option. I presume I would load the PDF into the AcroPDF control and then print?
    Steve_McKinney@adobeforums.com Guest

  7. #6

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    Yes, that is what you do.

    Sabian
    Sabian_Zildjian@adobeforums.com Guest

  8. #7

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    I have used the printall method with success, but only with local file system files. Is there a way I can load a file from the server side via a URL?

    Right now, my client-side javascript will load a file on the client machine (ie. c:\path\to\filename.pdf), but I need to perform loadFile(URL/file.pdf) because I want to wait until the file is loaded until I try to print.

    Thanks,
    Brian
    Brian_L_Lawson@adobeforums.com Guest

  9. #8

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    There is no support for loading PDFs via URLs in the ActiveX control.
    Leonard_Rosenthol@adobeforums.com Guest

  10. #9

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    IF that were entirely true, then the whole purpose of this thread is moot (automating printing server side). It is possible to load the file via URLs using the following html code:
    ----------------------------------------------------------





    function waitLoad()
    {
    setTimeout("printFile()",2000);
    }

    function printFile()
    {
    var objPdf = document.getElementById('pdf');
    objPdf.PrintAllFit(1);
    }


    -------------------------------------------
    So, if I used php or some other scripting language on the server to fill in the name of the pdf, I can load it via a URL, wait a couple of seconds for it to load, and then print it without user interaction. I wish that the LoadFile method would load a URL so that when it returns, I know it is loaded and I don't have to put faith in a timer that may not be enough for a large file.

    This is the situation I'm in. This way works but I don't like the timer. I'd rather have the plugin let me know when it's loaded. Is there another method that can help me do what I want?

    Thank again.
    Brian_L_Lawson@adobeforums.com Guest

  11. #10

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    Sorry for the confusion, let me pick my words more carefully...

    There is no methods for loading a PDF via a URL in the ActiveX control APIs. What you are doing in your code is actually having the web page load the PDF - that's different (and obviously works).

    Now about your task...

    Silent printing (aka printing w/o user interaction) is considered a security violation and is no longer supported by Acrobat/Reader except in a trusted context. You wouldn't want to be browsing to a web site and have your printer start spewing junk, would you??

    If you are working in a controlled environment, then I recommend you read up on the new Reader 9 Security Model and it's Trust Manager.
    Leonard_Rosenthol@adobeforums.com Guest

  12. #11

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    Is there a method on the ActiveX control to let me know when the file is finished loading?
    Brian_L_Lawson@adobeforums.com Guest

  13. #12

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    No.
    Leonard_Rosenthol@adobeforums.com Guest

  14. #13

    Default Re: How to automate the Acrobat Reader plugin in Internet Explorer

    I was looking through the Interapplication Communication API guide and it seems to say that the ActiveX control has a Src() method that will set a document's URL. Can't that be used to open a pdf via URL, then use the PrintAllFit() to do what I want?
    Brian_L_Lawson@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139