1 Reply Latest reply on Apr 16, 2010 12:48 AM by sudar1983_14

    [JS:CS4] - How to Load the PrinterPreset in InDesign

    Adobe-InDesign CS4

      Dear All,

       

      I'm having the Printer Presets ".prst" in some where in the local machine, How to Load this preset in to Application though javascript.

       

      I can create the preset through :   preset.add() method. but I can't load from the user given or mentioned path itself.

       

       

      Please any one give me the solutions, then I will appreciate....

       

      Thanks & Regards

      T.R.Harihara Sudhan

        • 1. Re: [JS:CS4] - How to Load the PrinterPreset in InDesign
          sudar1983_14 Level 2

          Please find the following code, which will remove all the print presets before adding our preset to the application.

           

              //Removing all printerPresets from the application
              for(var pP=0; pP < app.printerPresets.length; pP++)
              {
                  var myprintPreset = app.printerPresets.item(pP);
                  if (String(app.printerPresets.item(pP).name) != '[Default]')
                  {
                      myprintPreset.remove();
                  }
              }
             
              //Adding our preset to the application
              var printPreset;
              printPreset=File("c:/test.prst");
              app.importFile(1918071916, printPreset);
              myprintPreset=app.printerPresets.lastItem();
              myprintPreset.printFile = File(aDoc.filePath+'/'+String(aDoc.name).substr(0, (String(aDoc.name).length-5))+'.ps');
              aDoc.print(false, myprintPreset);

           

          Arivu