[JS CS3 Win] Export to PDF then auto-print PDF from Acrobat

Hello!
I am working on the script that is exporting pages to PDF, and would like to automatically send exported PDF to print from Acrobat.
I get the scripting part for exporting to PDF, and it's working very well, but I have trouble on the part of the script that tells Acrobat to open the PDF and send it to printer. Script is run from InDesign, so I thought this is right forum to ask.
The following part of the script is working OK on one computer, but on other two computers with similar configuration (CS3. Windows, Acrobat 8) it doesn't work at all and I can't figure out where is the problem:
var printFile = "/c/temp/test.pdf";
var remoteScript = "printFile = decodeURI('"+printFile+"');\n";
remoteScript += "var doc = app.openDoc({cPath: printFile});\n";
remoteScript += "var pp = doc.getPrintParams();\n";
remoteScript += "pp.pageHandling = pp.constants.handling.shrink;\n";
remoteScript += "pp.NumCopies = 2;\n";
remoteScript += "pp.interactive = pp.constants.interactionLevel.silent;\n";
remoteScript += "pp.printerName = '\\\\hrhqzgw23prn01\\\hr300019ps';\n";
remoteScript += "doc.print(pp);\n";
remoteScript += "doc.closeDoc(true);";
acrobat.executeScript(remoteScript);
I would appreciate any help. thank you.

Hi Mark,
Here is a sample script. It exports the active InDesign document to pdf file, using its base name, to the root of C drive. Then opens the exported file in Acrobat, prints it to the default printer and silently closes it.
Tested on InDesign 5.0.3, Acrobat 8.0.0, Windows XP SP3.
#target indesign
var myIndesignDoc = app.activeDocument;
var myBaseName = GetFileNameOnly(myIndesignDoc.name);
var myFile = new File( "/C/" + myBaseName + ".pdf" );
myIndesignDoc.exportFile( ExportFormat.pdfType, myFile, false );
var myScript = 'var myAcrobatDoc = app.openDoc( "/C/' + myBaseName + '.pdf" );\n';
myScript += 'myAcrobatDoc.print( {bUI: false, bSilent: true} );\n';
myScript += 'myAcrobatDoc.closeDoc( true );';
var bt = new BridgeTalk;
bt.target = "acrobat";
bt.body = myScript;
bt.send();
function GetFileNameOnly(myFileName) {
    var myString = "";
    var myResult = myFileName.lastIndexOf(".");
    if (myResult == -1) {
        myString = myFileName;
    else {
        myString = myFileName.substr(0, myResult);
    return myString;
Short explanation of the acrobat script:
1. Open the pdf file, just exported from InDesign
var myAcrobatDoc = app.openDoc( "/C/' + myBaseName + '.pdf" );
2. To print the document silently I use the doc object’s print method and set the following parameters:
bUI -- Determines whether to present a user interface to the user
bSilent -- Suppresses the Cancel dialog box while the document is printed
myAcrobatDoc.print( {bUI: false, bSilent: true} );
3. Close the document without notifying the user:
myAcrobatDoc.closeDoc( true );
Regards,
Kasyan

Similar Messages

  • I have been unsuccessful merging serval pdf files into one file.  I select the Sidebar for both pdfs, then drag one pdf on top of the other and Save the Version.  When I open the file I think I have saved, it shows only the original pdf.  Advice would be

    I have been unsuccessful merging serval pdf files into one file.  I select the Sidebar for both pdfs, then drag one pdf on top of the other and Save the Version.  When I open the file I think I have saved, it shows only the original pdf.  Advice would be appreciated.  Thank you.

    wouldnt it be easier if you could do something like this?
    https://discussions.apple.com/thread/3392535

  • Acrobat on OSX does not use printer preset. Every single time I have to print I have to click printer and then print to load the preset and then click print again from the main dialog. I am printing to a Xerox that has the copier code in the preset so if

    Acrobat on OSX does not use printer preset. Every single time I have to print I have to click printer and then print to load the preset and then click print again from the main dialog. I am printing to a Xerox that has the copier code in the preset so if I don't do this it will not print. This has been broken for in every version I have tried. This extra clicks are taking years off my life. Did I remember to do the extra clicks? I don't know, I guess I will run down the hall and check. Please fix this.

    What operating system are you running? I assume they had you install the latest BIOS. True? If it were mine, I would suggest forcing it to use integrated graphics (in the BIOS) to rule out a problem with the NVidia driver.

  • Difficulty printing colors from Acrobat 8 PDF

    I'm running Acrobat 8.1.2 and InDesign CS3 5.0.2.
    We created a file in ID3 using two boxes containing Pantone color with transparency added. The color appears over a placed tif graphic that also had some transparency applied and a placed PDF with no transparency. Everything works properly when the file is exported to Acrobat 8 and printed from Acrobat 8.
    We sent the file to a user in another area who still has Acrobat 7 and when they print the file they lose the colors. If we send the job to their printers from Acrobat 8 the colors print correctly so it doesn't seem to be a printer issue.
    The Acrobat 7 user can print the file by choosing Print as Image under Output, but we are looking for what is causing the difficulty. Any ideas would be grealy appreciated.

    I have no idea about the extend tool. You need to update to the latest version of AA 8, but it appears you are there with 8.3.1. You should print to the Adobe PDF printer. OFFICE 2013 is not compatible with the AA8 PDF Maker. So far I have only seen one person suggesting success with AA8 and Win8.1. If you can give details about your problem, we might be able to help, but you may not be successful. Only time and trial will tell.

  • Printing problems from acrobat with recieved pdf's

    Hi everybody,
    We have a problem with printing PDF files on windows 7 32 bit. This only happens with files that have come through one persons emails. When you open the PDF file from outlook it works fine but when you print it it crashes the print spooler service and the print job gets stuck in the print queue then you have to go into the queue and manually delete it. When I open pdf files that i have downloaded it all seems to work fine and will print.
    Any help would be muchly appreciated
    Also from this email you can email to an xp machine and it prints but if you email to the other windows 7 machine it does the same thing. But the other windows 7 machine can print thier PDF's from thier emails
    Thanks
    Jake

    Quite frankly, it would really help the Adobe Acrobat team if you at least provided information as to what version of Acrobat or Reader you were using, what type of printer (manufacturer, model, and whether PostScript or not), etc.
    We are not aware of a general problem of the type you describe and such information would help us track the issue down to assist you and any other users.
              - Dov

  • Only pdf's will print wirelessly from my iMac!  Help!

    I have setup Airport Express as a base station and I setup one as my wireless print server.
    My old ibook G4 prints everything beautifully to the printer.
    However my nice new iMac will only print pdf's! If I try to print a web page or a mail message, it appears to be sending the file, but then the job shows "stopped" and it won't print.
    Please help because this makes NO sense.

    What router?
    Download and run this: http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03286146&cc=us&dlc=en&lc=en
    What does it say?
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Auto printing PO from SRM thru ECC in Extended Classic 5.0

    We are trying to print our PO's and sent then thru Smartforms ZNEU from SRM thru the back end(ECC). This was working OK until we installed new patches on the ECC side.
    The ZNEU would print the Po and sent the EDI transfer from the back end with out manual intervention. Can some one tell me how we can set this backup to sent the PO print over to the back end to print.
    Thanks,
    Sam

    Hi Sam,
    Generally PO Messages will be created in SRM only in ECS.
    Did you do any development for this specail request to create a message in ECC ? check it up.
    br
    muthu

  • Flash Pro (CS3) will not open after file 'AuthPlay.dll" removed from Acrobat 9.

    A recent Adobe security issue recommened removal of 'AuthPlay.dll' from Acrobat Pro v9x.  When trying to open Flash Pro (CS3) the program throws an error " The AuthPlay.dll/Lib is missing from the configurration folder" and the program will not run.  Anyone know of a workaround or a way to open Flash Pro without the dll in question?

    Mountain LION is not a supported platform for Adobe Contribute CS4. The supported versions are Latest Adobe Contribute 6.5 and Adobe Contribute CS5.X.

  • Scanned doc, saved as Acrobat X pdf, then edited, prints only edits not the whole saved pdf

    In PS CS5, I imported a text document from scanner. I made some edits, including some paint brush (white on white) and some text layers. I saved it as a pdf and then opened it in Acrobat X 10.0.10, then printed it. Only the text layer edits themselves printed and not the rest of the original document with the edits.I think the problem lies with Acrobat, so posted here.
    Win7 SP1

    This is bordering on breaking physical laws. In PS the only thing that prints are the changes on created layers. The original document (background) does not print along with my changes, the same output as in Acrobat. Then in PS I saved it as a jpeg. Im looking at the image of the changed document in its entirety in the photo viewer but the same thing happens as in PS and Acrobat - only my changes (new layers) print, nothing else. Thats kinda creepy...

  • PDFs display and print fine in Acrobat but not in Preview of PDFPenPro

    I have a curious problem in that check boxes in certain PDF files (insurance applications) appear as a "p" instead of a check box when I view the file in Preview or PDFPenPro. The check boxes appear and print properly when I open the PDF in Acrobat.
    I've checked the fonts with the Apple Font utility and there seems to be no issues with any of the fonts.
    Any suggestions?
    Thanks.
    Bud

    Hi,
    Strangely I'm now having exactly the same problem all of a sudden.  I've been building the book for about a month now (I've made about 6 before without any trouble) and along the way have been producing a pdf of the book to see how it will look.  Yesterday I noticed some of the images seemed to have lost colour when looking at the pdf version and then today, many pictures all of a sudden look exactly like the example you've supplied above. 
    I've tried shutting down my imac and restarting thinking it was a memory issue, have checked if I had any filters activated (which I don't and I haven't used filters in books before either), have tried repairing then rebuilding aperture, copying the book to a new library, new location, opening on a different mac and then printing again but none of this had any positive effect. 
    So from what I understand from your last post, the workaround you came up with was to revert to the original of each image that had the problem and then make the adjustments again? 

  • AP Check Print: Same PDF O/P prints differently from Different Printers

    hi ,
    I am working on AP Check Printing. We are upgrading our system from 11i to R12.1.3.
    I have developed the Check Template for a US Check, the PDF output generated from the "Format Payments Instructions" look good and prints perfectly onto one printer.
    But when i print the same o/p to a different printer, it is cutting off all the edges.
    I have verified that both the Printers use Universal Pasta Configuration & the same past_pdf.cfg file.
    It has "Prepocess = pdftops - paper match {outfile} {infile}" as the command to convert PDF output file into a PS (Post Script).
    I am able to reproduce the problem by printing the PS file from unix using the command "lp - d <printername> <PS File Name>".
    Please advice ASAP, this is a BLOCKER issue for us and need to solve this at the earliest.
    Thanks in Advance.
    VIJAY

    Hi,
    Thanks a bunch for your quick response.
    In order to check the driver, i have seen in the following areas.
    System Admin => Install => Printers => Register /Type /Style / DRIVER.
    The driver postion is actually depending on the print style like "PDF Publisher" or "Portrait For Logo" etc.
    Is this the place you want me to check ? or is there anything else i am missing ?
    Thanks,
    Vijay

  • PDF will not print correctly from any app

    I seem to keep on getting the same error everywhere I print on SL (from safari/firefox/preview etc etc)
    It will usually print any lines or logos but miss all text?? I did have the dreaded adobe reader installed but have since removed it?
    I am in urgent need of printing out some manuals for a class so in real trouble, help!

    Where do these PDFs that do not print correctly come from? Are they downloaded from the internet or from email? Or do you create them yourself on your computer? If so, in which program?
    Do some PDF files print correctly, but not others? Did you remove the dreaded Acrobat Reader before this problem developed or after? Did this problem develop only after you ungraded to a certain release of Snow Leopard or has it never worked in SL?
    PDF is wonderful technology, but every so often there can be issues.
    Arch

  • Right clicking PDF files and printing those with Acrobat Reader X

    We have a Windows XP computer with Adobe Acrobat 7 Professional and Acorbat Reader X.
    Now when we open PDF files they open with Acrobat Reader X wich is fine.
    But when we try selecting PDF files and right click Print them they print with Acrobat 7 Professional.
    The problem is with Adobe Acrobat Professional 7 it doesn't print all the files we selected.
    We select 50 files and only about 10 are printed and those are always random.
    So is there anyway to enable the print option to print with Acrobat Reader X ?

    This is not a desirable situation. Adobe recommends against having Reader and Acrobat on the same machine, unless they're both version X, exactly because it can cause this kind of conflicts.

  • How to print portrait from acrobat 11, win 8

    I am using win 8 on a HP laserjet P1102W printer and only on Acrobat 11 am unable to print in portrait form regardless of file. I have no problems with other software regarding this.
    Any help appreciated
    pcguy177

    As someone with over 20 years experience I naturally have tried switching the orientation to Portrait and every other way known, including landscape which didn't do anything different. I do desktop publishing so I have used many types of printers and software's none have caused this problem. I don't have this problem with any other software including Office, Photoshop, or even right off the web. Only Adobe Acrobat 11 with Win 8 has caused this. I wouldn't have gotten Win 8 but it came with my laptop. My desktop is old and not wireless so I have no intention of running wires around the house when my laptop does everything else well. I know XP probably would work without any problems but again not into the trouble to hook it up. It's so old that I can't even use a wireless USB transmitter because they require at least 2.0 USB to work, already tried it.
    Thanks for the thought though. If you can think of anything else you never know what might work. I am thinking of upgrading to 8.1 but have not heard good things about it so not rushing into that direction quit yet.
    Oh yea unable means not able to do a specific thing, in this case printing portrait printing or normal for most people, this is usually the default settings of most printers.
    Guy

  • PDF file prints fine from Acrobat reader XI, but not Acrobat Standard XI

    I have a 2 page document that is set up as tabloid 11x17, meant to be printed duplexed and folded as a 4 pamphlet.  The document with the same printer settings prints fine from Adobe Reader XI but from Adobe Standard XI, Page 1 prints fine, but page 2 looks like it is  trying to print on the backside of an 81/2x11 instead of 11x17.  I have played with the print settings in Standard, and cannot come up with a combination that prints that document correctly, yet it prints fine from Acrobat Reader XI.  I did double check for updates on both products and installed them.  Anyone have any idea as to why this is happening?  If I print page 2 by itself it does print properly, just not when sent duplexed with page 1.

    Well, for those following this thread or needing a solution, I found a work-around though I'm still not sure why the initial problem exists.
    In Acrobat 9 Pro, once you have the main print dialogue box open, follow the steps below:
    1) Click ADVANCED
    2) Select PRINT AS IMAGE
    3) Set DPI to 300
    4) Click OK
    5) Make any other typical print setup adjustments as you normally would and finish printing as usual

Maybe you are looking for