0 Replies Latest reply on Dec 13, 2011 9:29 AM by booyajamo

    [JS][CS4] - printFile to PDF

    booyajamo Level 1

      Hello,

       

      I need to write a script that prints to PDF (instead of export to PDF).  I've looked through the Object Model and it seems the "print File" property is only valid if the printer is postscript file. The code I've written works although I'd really like to bypass the dialog box that comes up wanting to know where to save the PDF to and what to name the file.

       

      Is there really no way around it?

       

      doc = app.activeDocument;
      
      with (doc.printPreferences){
           printer = "Adobe PDF";
           printFile = new File("C:/mydocs/" + docname.split(".indd") + ".pdf");}
      
      doc.print(false);
      

       

      I'm not opposed to using .exportFile; however, I've not been able to get the file size as small as if I print to PDF. If anyone has advice about how to acheive the same file size via .exportFile I'd be very interested.

       

      Thanks!

      Lindsay