Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Script for putting pages 4up

Return to Member Forum

  • Author
    Posts
    • #1188102

      Hi all,

      I work for a company who does a lot of printing.

      I am a desktop publisher myself and I have the task to prepare the documents. As it is useful to use an imposing program, I rather like to use InDesign, as it is most useful for me and my colleagues. I have used quite imposing in the past and it is amazing.

      Now the question is, I would like to find a script that makes it possible to put a document a given amount of times on a page.

      Let’s say you have a document with the size of A3, and I want to put 4 A5 pages on it, I would like the script to do this for me.

      As in if the document is A6 it will put it 8 times on a A3.

      Is this possible with scripting?

    • #14323996
      Robert Ploch
      Member

      Hello Jelle,

      If you have prepared template (e.g. A3) full of graphic frames in certain grid this piece of code will put choosen file into all the frames. If orientation of choosen file won’t conform shape of the graphic frame, script will rottate imported file.

      I’ve tested it shortly on Indd files – template A3 and A5. The script should work regardless of format if formats will conform eachother

      best
      Robert

      PS. If you will have problems with copying and pasting code to ExtendScript toolkit write my your e-mail, so I’ll send you a script file.

      var toPlace = File.openDialog (‘Select file to place.’, ‘*.*’, false);
      if ( !toPlace ) { exit(); }

      place ( toPlace );

      function place ( file ) {

      app.activeWindow.transformReferencePoint = AnchorPoint.CENTER_ANCHOR;

      var f = app.activeDocument.rectangles, i = f.length;
      while ( i– ) {
      try { f[i].graphics[0].remove(); } catch (err) {}
      with ( f[i] ) {
      place ( file ),
      clearTransformations(),
      clearFrameFittingOptions(),
      fit( FitOptions.CENTER_CONTENT )
      }

      if ( ( ( f[i].geometricBounds[3]-f[i].geometricBounds[1] ) < ( f[i].graphics[0].geometricBounds[3]-f[i].graphics[0].geometricBounds[1] ) ) ||
      ( ( f[i].geometricBounds[2]-f[i].geometricBounds[0] ) < ( f[i].graphics[0].geometricBounds[2]-f[i].graphics[0].geometricBounds[0] ) ) ) {
      f[i].graphics[0].rotationAngle = 90;
      }
      }
      }

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Forum Ads