Printing  a .pdf file by javascript?

Is it possible to print a .pdf  file  by javascript function or Adobe javascript and how ? I hope that one expert can share me a sample javascript function.
Thank you very much in advance.

Hi, thank you for your answer.
Is it possible for me to reference Acrobat javascript api inside asp.net web application and how ?
Thank you  and I appreciate your help.

Similar Messages

  • Firefox 4.0 support for printing embedded PDF files in iFrames via JavaScript

    I recently upgraded to Firefox 4.0 and can no longer print embedded PDF documents contained in an iFrame.
    My company's web application has several pages which load PDF files from a Servlet into an iFrame. The pages in question all have "Print" buttons which when clicked executes a JavaScript function to obtain reference to the iframe containing the PDF, place it into focus() (e.g., frames['pdfdoc'].focus();), and invoke print() (e.g., frames['pdfdoc'].print();). There are no errors, or exceptions caught when the JavaScript function is invoked, but the "Print" button is no longer operational.
    Does Firefox 4.0 no longer support iFrames? The issue goes away if I revert back to ver 3.6.16

    I have same issue for printing embedded PDF files in iFrames via JavaScript in Firefox 5.0.
    In previous versions it was working fine. But not in Firefox 4.0/5.0.
    Is there any solution for this problem?

  • Printing a PDF via Acrobat Javascript

    Hi -
    I have a need to print a PDF programmatically, via Javascript.  The PDF is embedded in a Web page.  I use postMessage to communicate with the PDF.
    I've created a simple HTML page with an embedded PDF, and a Javascript link to call my "Print" function. Here's a code snippet:
    <body>
             <a href="javascript:doPrint();">Print</a>
             <object id="PDFObj" data="testPDF.pdf" type="application/pdf" width="400" height="400" />     
    </body>
    In the HTML document's HEAD, I've added the following Javascript which posts the message to the PDF:
    <script language="JavaScript">
            function doPrint() {
                pdfObject = document.getElementById("PDFObj");
                alert("Hello from Javascript...");
                pdfObject.postMessage(["Print", "Print"]);
    </script>
    Finally, I've added an Acrobat Javascript function in the PDF document to listen for the postMessage event:
    function myOnMessage(aMessage)
        app.alert("Hello from the PDF");
           // print routines here
    var msgHandlerObject = new Object();
    msgHandlerObject.onMessage = myOnMessage;
    msgHandlerObject.onError = myOnError;
    msgHandlerObject.onDisclose = myOnDisclose;
    function myOnDisclose(cURL,cDocumentURL)
    return true;
    function myOnError(error, aMessage)
    app.alert(error);
    this.hostContainer.messageHandler = msgHandlerObject;
    Here's my problem: when I test this code and click the HREF Javascript link, I see "Hello from Javascript..." and "Hello from the PDF," so I know the postMessage event is working.  However, I've tried every print command I know in the myOnMessage function, and nothing seems to work:
    app.execMenuItem("Print"); // doesn't seem to work
    this.print(); // doesn't seem to work, even when I pass in all the params, etc
    I've also tried getting print params and passing those in, nothing seems to work.  Am I missing something?  Environement is Acrobat 9 Pro, browser's tested include Chrome 2.0, IE6.  I've attached two files, the HTML bit and the PDF I'm trying to print.  Any help is greatly appreciated!

    You have to be careful when using the ActiveX control to communicate with system functions like printing.  Because it can be embedded in anything that supports ActiveX, some functionality is limited from being called from JavaScript as it may interfere with the host application.
    Check out the IAC API Reference (also included with the SDK) and the methods under AxAcroPDFLib.AxAcroPDF.  There are some print functions in there (like PrintAll) that you can call on the ActiveX control directly, as in from your doPrint() method in your HTML page without using the hostContainer.  You would basically just call:
    pdfObject = document.getElementById("PDFObj");
    pdfObject.PrintAll();
    These methods were designed specifically to work with the ActiveX control when embedded in a host application, and can be used to print a PDF embedded in a web page.

  • Cannot print a PDF file after upgrading to Windows 8.1

    Cannot print a PDF file after upgrading to Windows 8.1
    I can print anything else from either the Desktop or Start but not a PDF.  No error message but just does not print.
    Update: down loaded Adobe Reader which runs on the desktop so when I read a PDF file it now runs on the desktop and I can print it.

    Cannot print a PDF file after upgrading to Windows 8.1
    I can print anything else from either the Desktop or Start but not a PDF.  No error message but just does not print.
    Update: down loaded Adobe Reader which runs on the desktop so when I read a PDF file it now runs on the desktop and I can print it.

  • I am trying to print a PDF file to a legal size paper and I would like for it to fill up the page. How do I do this? I went into the settings and changed it from letter to legal, but it's still printing out the same size. Can someone help me, please?

    I am trying to print a PDF file to a legal size paper and I would like for it to fill up the page. How do I do this? I went into the settings and changed it from letter to legal, but it's still printing out the same size. Can someone help me, please?

    Are you trying to Print to PDF or are you trying to Print a PDF file to a physical printer?

  • How do I download and print a pdf file in osx mountain lion

    How do I download and print a pdf file?

    control click on your PDF to download option
    Open it on your desktop Command-P is the short cut for print option.

  • How to Print  a PDF file from within a ABAP ( from gui input)

    Hi champions,
    This is Client requirement:
    "We need to print a PDF file from within a ABAP"
    We first need to test whether it is even feasible, and then if it 
    is, then write a small test ABAP which can accept a PDF file
    name as input (from GUI) and then print it to a SAP print
    device (printer).”
    Please Can any body help me on this.......
    It's urgent
    Thanks
    Basu

    Check following blog for PDF output from SAP
    /people/thomas.jung3/blog/2005/04/28/setting-up-an-adobe-writer-for-abap-output
    anya

  • Print a pdf file from sap

    Hello,
    I'm looking for a way to print a .pdf file from sap . The file  was created manualy and is in a newtwork folder.
    I have to send the print to a network printer . Is it possible to use the AcroRd32.exe as a command line?
    Thank you.

    hii,
    try this
    CONVERT_OTFSPOOLJOB_2_PDF
    http://help.sap.com/saphelp_nw04/helpdata/en/27/67443cc0063415e10000000a11405a/content.htm
    PDF - Printing a PDF file from ABAP or SAP Script
    regards,
    Sri.

  • How can I print multiple PDF files at once using Windows 7?

    How can I print multiple PDF files at once, on an HP LJ Pro 400 xcolocr printer without opening each
    one separately using Windows 7?

    I am sorry, but to get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial printer. You can do this at http://h30499.www3.hp.com/hpeb/
    I hope this helps.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Why can't I print a PDF file?  message says no pages selected to print

    When I try to print a PDF file I get two messages 'This document could not be printed.' Then 'There were no pages selected to print.'  How do I select a page to print?  or is there something else?

    What is your operating system?  Reader version?

  • Why can't i print a pdf file, it's asking for a password and i have no idea what it is it's never asked me before?

    why can't I print a pdf file, it's asking for a password and I have no idea what it is it never asked for one before?

    Good afternoon SaraThanks for responding. Yes, I have been able to open these files before without a password. Funny thing is it is happening on both my husband's laptop as well as mine. I'd appreciate any help you could give me but the file is very personal. So, if you can assist in a way that won't compromise the security I would be grateful for your help.Thanks and have a great day!Kim Morse 

  • How can I print a pdf file in Windows 8?

    I'm new to Windows 8. How can I print a pdf file in Windows 8?

    Well, you can install Adobe Reader XI - not the version for Windows 8 tablets, but the one for regular PCs. This is just the same in Windows 8 as other systems, and can print. The tablet reader, which also runs on PCs, can't print.

  • Can I print a pdf file from an email on an HP printer Deskjet 5100?

    Can I print a pdf file received through Email on an HP Deskjet 5100 printer and how?

    Save the file to your hard drive, open it in Adobe Reader and print.  Unless the file has security restrictions against printing, those steps should work.
    -David

  • I can not print a pdf file that was sent in an email.  I get the error message that adobe could not

    I can not print a pdf file that was sent in an email.  I get an adobe error message that it can not print with an ok to check and when i do I get another adobe error message that says I did not select a page to print. I have downloaded the latest adobe download.  I forwarded the email to my husband and he printed the document just fine.

    This first question which comes to mind is how do you display the pdf file in the browser?
    For this the browser uses a plug in (e.g. adobe reader) which already has the ability to print the pdf file. Depending on the version of your plug in, printing is started differently.
    Timo
    Ps: which jdev version do you use?

  • Printing problems (PDF files-HP Color Laserjet 1518ni: return the printer?

    Hi everyone, I recently switched platforms and became a Mac user and had to buy a new
    printer because my old HP deskjet is not compatible with my computer. So, I bought an HP
    Color Laser printer, supposedly Mac compatible, but every time I try to print a PDF file it only
    prints the first page. And then stops printing. I spent hours with the HP customer service, reinstalled
    the driver, changed configurations, but it still does the same thing. The customer service representative could not solve the problem. I was wondering if there is any one else who had a similar issue with printing? Is it Mac OS X 10.5.5 that causes the problem? I am about to return the laser printer; it would be so helpful if I got some feedback. If it is a printer issue, then, which printer would you folks recommend that is not too expensive but efficient (I use the printer a lot and need an efficient one) and a printing speed of around 12-20ppm that actually does work with the Mac?
    Thanks in advance!
    Asli

    Asli Igsiz wrote:
    Thank you for calling my attention to the Adobe issue. I did try and print a PDF file with Preview and it worked! How was the issue solved with Adobe 7? Maybe Adobe pro7 also similar bug issues; is it to Adobe that I should be reporting this or to Apple?
    Thanks again.
    It's definitely an Adobe problem. The only solution I ever saw was either to print from Preview or to use later versions of Adobe Reader 8 or any version of Reader 9. I asked Adobe support what the problem was. I never got a reply.
    You should know that Preview (and any other application which reads PDFs using Apple's PDF engine) has a problem with displaying Times Roman Italic, and only Times Roman Italic when launched under OS X 10.5.5. All other fonts appear to work normally; at least I haven't found one which has a problem, including other Times Roman font faces, including Times Roman Bold Italic. Preview seems to print properly, but the on-screen display has problems. The same files display properly with apps which don't use Apple's PDF engine, and also with apps which use Apple's PDF engine under versions of the OS earlier than 10.5.5, going back to at least 9.2.1. Apple is aware of the problem.
    There seems to be at least two problems with the main PDF engines for OS X, Apple's and Adobe's.

Maybe you are looking for

  • Need help with Olympus E-M1 and ACR 8.3 Results

    Hi: 1.  I'm fairly familiar with photoshop and ACR, but definitely not an expert.   I'm also very familiar with the Olympus RAW files since the E-5 (I've owned the E-5, E-M5 and several Pens);  I now recently purchased the E-M1 and I've been having p

  • Element _WF_PARFOREACH_INDEX

    Hi experts, what is the element WFPARFOREACH_INDEX in WF's container? How is it filled? Thanks and regards Antonella

  • Logic Pro 7 crashes on launch with brand new G5 dual 2.3

    I just unboxed my new G5 and did the transfer from my old G4 with the "target disk" mode (I believe that's what it was called). The first couple of times I tried to launch Logic it crashed during Au validation, now it crashed right away (Logic screen

  • I am trying to reinstall adobe photoshop elements - got error -115

    I reformated the hard drive on my HP Pavillion a6120n and am now reinstalling my adobe photoshop elements and I get an error code of -115. How do I proceed? Jan

  • Table type mulit and auxiliary

    difference between a table type auxiliary and table type multi ? where exactly we are using this ? can give some simple example plsT