5 Replies Latest reply on Jan 24, 2013 3:42 AM by -hans-

    Export all items of the pages in jpg [HELP]

    gutie91 Level 1

      hi,

      how could export to jpg all items in a document indesign?

      and also need measures each item.

      if someone could help me I would appreciate

      sorry for my English

       

       

      thanks

        • 1. Re: Export all items of the pages in jpg [HELP]
          -hans- Level 4

          Hi,

           

          really EVERY page item of a document?

          What about groups, anchored objects ...

           

          Please provide some further instruction

           

          Hans-Gerd Claßen

          • 2. Re: Export all items of the pages in jpg [HELP]
            gutie91 Level 1

            I would like to take groups and images, but the images with the measure having indesign

             

            thanks for the message

            • 3. Re: Export all items of the pages in jpg [HELP]
              -hans- Level 4

              start here:

              exports page items to created subfolder.

              jpg-naming: sourcepage + itemcount

               

               

              #target InDesign 
              
              //set properties for export to your needs
               with(app.jpegExportPreferences){ 
                  antiAlias = true; 
              embedColorProfile = false; 
              exportResolution = 300; 
              jpegColorSpace = JpegColorSpaceEnum.RGB; //JpegColorSpaceEnum.CMYK, JpegColorSpaceEnum.GRAY     r/w    One of RGB, CMYK or Gray 
              jpegQuality = JPEGOptionsQuality.HIGH; //JPEGOptionsQuality.LOW, JPEGOptionsQuality.MEDIUM, JPEGOptionsQuality.HIGH, JPEGOptionsQuality.MAXIMUM     r/w    The compression quality. 
              jpegRenderingStyle = JPEGOptionsFormat.BASELINE_ENCODING; // JPEGOptionsFormat.PROGRESSIVE_ENCODING     r/w    The rendering style. 
              simulateOverprint = true; 
              } 
              
               //doc has to be saved once
              var theDoc = app.activeDocument; 
              var docName = theDoc.name; 
              var docShortName = docName.replace(/.indd/, '') 
              var docPath = '' + theDoc.fullName; 
              var docContainerPath = docPath.replace(docName, '') 
              var destPath = docContainerPath + '/' + docShortName + '_jpgExport/' 
              if(Folder(destPath).create() != true){alert('Could not create targetfolder.'); exit();} 
              
              var pageItems = theDoc.pageItems.everyItem().getElements(); 
              
              l = pageItems.length; 
              counter = 0;
              for(var i = 0; i < l; i++){
                  counter = counter + 1;
                  var singlePageItem = pageItems[i];
                  currParentPage = singlePageItem.parentPage;
              if(currParentPage == null){parentPageNumber = 'pasteboard'}else{parentPageNumber = singlePageItem.parentPage.name; }
              
              newFile =new File(destPath + 'page_' +  parentPageNumber + '_' + 'item_' + counter + '.jpg'); 
              
              if(singlePageItem.exportFile(ExportFormat.JPG,  newFile) === false){alert(newFile + ' could not write jpg-File.')}  
                      }
              
              • 4. Re: Export all items of the pages in jpg [HELP]
                gutie91 Level 1

                Forgive as you could run this code on mac? not to save it

                thanks

                • 5. Re: Export all items of the pages in jpg [HELP]
                  -hans- Level 4

                  gutie91 wrote:

                   

                  Forgive as you could run this code on mac? not to save it

                  thanks

                   

                  Sorry, but I don't understand this sentence ????

                  It's a extendscript and could be run from ESTK ...