3 Replies Latest reply on Mar 24, 2010 8:57 AM by [Jongware]

    Create Booklet

    René7

      Hi,

       

      I'm trying to create a booklet with a javascript in Indesign CS3.

      It should be somthing like:

      PrintBookletOption.BookletTypeOptions = BookletTypeOptions.TWO_UP_SADDLE_STITCH;

      Can someone help me with this?

        • 1. Re: Create Booklet
          [Jongware] Most Valuable Participant

          Just about everything private to InDesign should start with "app.", the base class of All Stuff InDesign. And if you check my handy JS Reference (http://www.jongware.com/idjshelp.html) you will see that PrintBooklet can only be called from with a "document" (which makes sense, as you cannot create a booklet without having a document first).

           

          "PrintBookletOption" is the name of a Class (an abstract definition of a data type). Checking same help, you will find it's used as a property in ... that same Document (where it's called "printBookletOptions").

           

          You should also be careful not to mix names of properties (bookletType) with those of the enumerated class that's used to assign its value (BookletTypeOptions). Sometimes the names of a property and its enumerated value type are very close; but always slightly different, since they cannot have the exact same name! By convention, Adobe uses initial lowercase names for properties and initial uppercase names for class and enumeration names.

           

          So what you need is, ultimately,

           

          myDocument.printBookletOptions.bookletType = BookletTypeOptions.TWO_UP_SADDLE_STITCH;

          • 2. Re: Create Booklet
            René7 Level 1

            Thanx.

             

            Now the next step for me is to place the .pdf or .ps file into a map.

            Can you also help me with this?

            • 3. Re: Create Booklet
              [Jongware] Most Valuable Participant

              The printBooklet command only works with Printer Presets. I never used these before, but I do read (in same aforementioned Help -- hint, hint!) that these have a property "printFile", which is a reference to a File.

               

              This suggests you should use something like

               

              myFile = File("/some path here/myFilename.ps");

              ...

              myPrintPreset.printFile = myFile;

               

              -- in the File constructor you can put any path and file name you like (the path should be one that's on your computer, or it will return an error).