none
Pdf print issue in IE10,IE9,IE8 RRS feed

  • Question

  • Hi

    I am trying to print pdf file in IE10,IE9,IE8 with the help of javascript .Please find source code.

     <script type="text/javascript">
            function printFrame(id) {
              
                var frm = document.getElementById(id).contentWindow;
                
                frm.focus(); // focus on contentWindow is needed on some ie versions
                frm.print();
                return false;
            }
    </script>

    <iframe name="myFrame" src="Bol_Portland.pdf" id="myFrame" width="10" height="10"></iframe>

    <input type="button" value="Print IFRAME" onclick="framePrint();" />

    Monday, September 2, 2013 11:50 AM

Answers

  • Hi,

    there is no way to reliably do this on a public access web site...PDF uses an ActiveX control to host the PDF document... there is no x64 version of Adobe Reader, user settings may prevent scripting of ActiveX controls.

    with the link solution above, users MAY choose the Print File context menu option to send the PDF document to their default printer.

    Refer to your PDF Reader's (Adobe?) support site for documentation about automating their Addon with script.

    http://acrobatusers.com/top-features/adobe-reader


    Rob^_^

    Wednesday, September 4, 2013 4:09 AM

All replies

  • Hi,

    you have errors in your script....

    f12>Console tab, .... refresh web page to show suppressed error messages and warnings.

    Post questions about html, css and scripting to the MSDN IE Web Development forum with a link to your website or publicly accessible mashup.

    I see you have already done this but have neglected to include the link to your website or mashup.


    Rob^_^

    Tuesday, September 3, 2013 12:23 AM
  • Hi Rob

    Thanks for your response. You have any solution for that. Issue is in only IE browser.

    Thanks

    mupadhyay

    Tuesday, September 3, 2013 2:45 AM
  • Hi,

    the interoperable solution is not to use iframes or objects to host PDF content.....

    <a href="/path/document.pdf" target="_blank">document.pdf</a>


    Rob^_^

    Tuesday, September 3, 2013 3:18 AM
  •  Rob thanks for your help. I am trying this changes in my code. I need to print pdf file without open it .I have to do in IE only. If you have any sample code please share me.   

    Thanks

    Tuesday, September 3, 2013 3:41 AM
  • Hi Rob

    I am waiting your response. If you have any idea or sample code please send me for print pdf client side without open it.

    Wednesday, September 4, 2013 3:13 AM
  • Hi,

    there is no way to reliably do this on a public access web site...PDF uses an ActiveX control to host the PDF document... there is no x64 version of Adobe Reader, user settings may prevent scripting of ActiveX controls.

    with the link solution above, users MAY choose the Print File context menu option to send the PDF document to their default printer.

    Refer to your PDF Reader's (Adobe?) support site for documentation about automating their Addon with script.

    http://acrobatusers.com/top-features/adobe-reader


    Rob^_^

    Wednesday, September 4, 2013 4:09 AM