2 Replies Latest reply on Jan 27, 2010 3:49 AM by FlexMitchell

    why can't disable print dialog?

    FlexMitchell

      I need print document to xxx.ps

      My codes are : ( delphi code)

       

       

      bsInDoc.PrintPreferences.ActivePrinterPreset := PStyle;

      bsInDoc.PrintPreferences.PrintFile :=  'C:\pstest.ps';

      bsInDoc.PrintOut(False,PStyle,False);

       

       

      While running this code, Indesign CS4 still raise a small dialog: ask fileName.

      Print.out method has 3 Parameters:

      PrintDialog: Whether to invoke the print dialog. Type: Boolean.

      Using: Printer preset to use. Type: idPrinterPresetTypes enumerator or PrinterPreset.

      WithGrids: Whether to print grids

      so, I set first parameter = False, the printdialog should not be invoked by Indesign CS4.

      But it does not, why?(refer to the figure as below)

      printdialog.JPG

      Anyone has idea about it?

       

      P.S: this Indesign CS4 is Chinese version. and there are two black form is my delphi program.

        • 1. Re: why can't disable print dialog?
          [Jongware] Most Valuable Participant

          The function suppresses InDesign's own Print dialog, not the one your system calls up.

          I think you get one from the system because you are printing to a file using your printer driver, rather than print to PostScript from InDesign.

          1 person found this helpful
          • 2. Re: why can't disable print dialog?
            FlexMitchell Level 1

            Finally, I solve this problem.

            The answer is so easy ,

            PrintOut(False).

            Just fill first first parameter, do not care the other two parameter.

            According to Indesign CS4 scripting document, it points out one thing is strange. Document says  InDesign.PrinterPreset.PrintFile :  The PostScript file to print to. Note: Valid only when the current printer is defined as postscript file. Then, I test setup PreinterPreset with postscript option or not, the result is same , Indesign will print document to .ps file. and I notice there is another method InDesign.PrintPreference.PrintFile has same definition. But, I do not figure out what is the difference between them.

            Actually speaking, I hope adobe script document can apply more examples to help user to understand it.

            Scripting can do a lot of smart things and saving manpower, what not let more user has scripting ability.

             

            P.S:  thanks a lot for Jonqware answer, your clue guide me to find correct answer.