4 Replies Latest reply on Feb 15, 2012 10:54 PM by jocstone_me

    export to pdf based on bleed per document

    jocstone_me Level 1

      hi,

       

      I want to make a script for doing the following:

       

      I have a folder with let's say 100 Indesign documents

      Many documents have different bleed setting, let's say, documents with 5 mm bleed, 10 mm bleed and 15 mm bleed

      I have PDF export settings for 5, 10 and 15 mm bleed, in fact, the only difference between the settings is the "Offset" of my marks, in all settings "Use document Bleed Settings" is enabled.

      I want to batch output all Indesign documents at once

       

      now, I have to look at each document, determine how many bleed it has, choose export, choose the right export setting according to the amount of bleed and finaly export to pdf.

       

       

      is there a way to make the script look at the document's bleed setting and make that value also the value for the "Offset" for the marks?

      so at the end, in all my pdf's, the crop marks should always be outside the cropbox. that is my goal.

       

      thanks.

        • 1. Re: export to pdf based on bleed per document
          Muppet Mark Level 5

          You should be able to do this… You either want a couple of if statements or a switch based on the latter…

           

          alert( app.activeDocument.documentPreferences.documentBleedUniformSize ); // Are all document bleeds the same value?
          
          alert( app.activeDocument.documentPreferences.documentBleedTopOffset ); // The measurement value…
          
          • 2. Re: export to pdf based on bleed per document
            jocstone_me Level 1

            thanx,

            yes, all documents have uniform bleed

            now I have to take that value to my export settings, not as bleed (this) but as offset for my marks.

            I will try this...

            I will post my results here

            • 3. Re: export to pdf based on bleed per document
              Muppet Mark Level 5

              I quickly put this together… You said in the first post you have 3 presets… Have you set the marks offsets in there? It's bare bones NO error trapping in it but you could add that… It would expect your named presets to exist… Just replace my '5mm' and so on with your names…

               

              #target indesign
              
              function exportFolder() {
                
                        var i, inFolder, idFiles, doc, offSet, pdfPre, pdfFile;
                
                        inFolder = Folder.selectDialog( 'Where\'s the folder of ID files?' );
                
                        if ( inFolder == null ) { return };
                
                        idFiles = inFolder.getFiles( '*.indd' );
                
                        for ( i = 0; i < idFiles.length; i++ ) {
                
                                  doc = app.open( idFiles[i] );
                
                                  offSet = doc.documentPreferences.documentBleedTopOffset;
                
                                  if ( offSet == 5 ) { pdfPre = app.pdfExportPresets.itemByName( '5mm' ) };
                
                                  if ( offSet == 10 ) { pdfPre = app.pdfExportPresets.itemByName( '10mm' ) };
                
                                  if ( offSet == 15 ) { pdfPre = app.pdfExportPresets.itemByName( '15mm' ) };
                
                                  pdfFile = File( doc.fullName.toString().replace( '.indd', '.pdf' ) );
              
                                  doc.exportFile( ExportFormat.pdfType, pdfFile, false, pdfPre, '', false );
                
                                  doc.close( SaveOptions.NO );
                
                        };
                
              };
              
              exportFolder();
              
              
              • 4. Re: export to pdf based on bleed per document
                jocstone_me Level 1

                Dear Muppet Mark,

                 

                you are my hero!

                 

                this works perfect

                 

                in fact, I have a total of 7 different bleed settings and export setting,

                 

                I just have to copy the "if" line, change the offset and export setting name.

                 

                You made me a very happy person!

                 

                Thanks!!