6 Replies Latest reply on Dec 12, 2013 7:07 AM by samaelok

    How to Export two different type of images at the same time?

    samaelok

      Hi everyone,

      I asked this in another forum and I was refered to ask this in the section of scripting.

       

      so there is my question :

       

      I currently work at a company who needs to export two different type of images, like Pdf and Jpeg, because they are going at different places.

      I found a way but it is long in my opinion. once I finished to build my indesign, I export every images as detached pdf Ex: Autralia Park-01_13832, then I combined them as one Pdf file. by that I save the rest as .Jpg ex: Australia Park-01-13832-Page01 and so forth.

       

      Is there a way to have a kind a of script like this or plugin like it.

       

      thank you!!

        • 1. Re: How to Export two different type of images at the same time?
          Jump_Over Level 5

          Hi,

           

          Is your goal to export each graphic used in doc or each page of multipage doc?

           

          Jarek

          • 2. Re: How to Export two different type of images at the same time?
            samaelok Level 1

            Well, I would like to be able when it is time to exporte, page 1,2,3 and more as a Pdf and Jpg at the same time. because now the way I do, we losing time.

            so I would like to be able to set-up when I export 2 different type like I said : jpg, + pdf and when I click ok it will export both.  for exemple . Australia park-01_12143.pdf, Australia park-01_12143.jpg and so forth.

             

            hope that does make sense.

             

            Sonny

            • 3. Re: How to Export two different type of images at the same time?
              Jump_Over Level 5

              Hi,

               

              Yes it makes sense, it is scriptable and I am sure most of members of this forum could write some code or even have it already.

               

              However the point is, you could be gladly helped here with writing some code by yourself.

               

              To do some job which can save your company time or money I suggest to contact any freelancer community.

               

              It looks quite easy at first look since you have to input info about:

              • output path for exported files
              • which PDF exportPreset should be used
              • which JPG options are you going to set while exporting

               

              all the rest is a code...

               

              Jarek

              • 4. Re: How to Export two different type of images at the same time?
                Mi_D Level 3

                hi samaelok try below code

                 

                //change Pdf_Presets[i].name as per ur preset

                 

                var myDoc = app.activeDocument;

                var myPage =myDoc.pages;

                   for (var p=0; myPage.length>p; p++)

                   {

                       var pageNumber = myPage[p].name;

                        exportPdf(pageNumber)

                      }

                //prf preset and jpg preference set as per ur costomer requirement

                function exportPdf(pageNumber)

                {

                var myDoc = app.activeDocument;

                var myDocName = myDoc.name;

                var myFolder = myDoc.filePath;

                var Pdf_Presets = app.pdfExportPresets;

                var myBaseName=myDocName.split(".indd")[0];

                        for(var i=0; i<Pdf_Presets.length; i++)

                        {

                            if(Pdf_Presets[i].name == 'Test'){

                                pdfPreset = app.pdfExportPresets.item(Pdf_Presets[i].name);

                                }

                        }

                        app.pdfExportPreferences.pageRange = pageNumber

                         app.swfExportPreferences.pageRange = pageNumber;

                        mypdfFilePath = myFolder + "/" + myBaseName  +"_"+pageNumber+ ".pdf";

                        myFilepdf = new File(mypdfFilePath);

                        app.activeDocument.exportFile(ExportFormat.pdfType, myFilepdf, false, pdfPreset);

                        expFile = File( myFolder + '/'+ myBaseName + '_' + pageNumber+ '.jpg' );

                       app.activeDocument.exportFile( ExportFormat.JPG, expFile, false );

                  

                 

                       

                }

                1 person found this helpful
                • 5. Re: How to Export two different type of images at the same time?
                  samaelok Level 1

                  Thanks for reply I would be glad for it hehe. I am kind of new with this program but I will for sure learn some code basics.

                  in the mean time it would be ncie to find some code soon.

                  • 6. Re: How to Export two different type of images at the same time?
                    samaelok Level 1

                    Thank you for the code. somehow I am new to this, I know that I need to transform that code in a vbs file then put that into the script folder. which I did.. but my problem now is I can't make it work.
                    Perhaps it is the way that I am trying to make it work but maybe it is the code.

                     

                    when I double click to run the script it shows me that.

                     

                    Windows Sripting Error!

                     

                    Error Number: 1024

                    Error String: Instruction Attendue

                     

                    Engine default

                    File C\ ***\****

                    Line 3

                    Source//change Pdf_Presets[i].name as per ur preset

                     

                    Or I am not sure what the result should be actualy.

                     

                    and wait, I succeed to save it into a jsx file. and I can open the code editor. when I press play to make it work it unlight that region :

                     

                     

                    app.activeDocument.exportFile(ExportFormat.pdfType, myFilepdf, false, pdfPreset);

                     

                    is there a reason why?