12 Replies Latest reply on Feb 13, 2013 3:30 AM by Velprakash

    Export Epub in InDesign CS5

    Oviya... Level 1

      Hi Friends,

       

      How can i export epub[Digital Editions] in InDesign CS5 java script...?

       

      Thanks,

      Divya.

        • 1. Re: Export Epub in InDesign CS5
          Oviya... Level 1

          ExportFormat.epsType

          ExportFormat.inCopy

          ExportFormat.jpg

          ExportFormat.pdfType

          ExportFormat.rtf

          ExportFormat.svg

          ExportFormat. svgCompressed

          ExportFormat. taggedText

          ExportFormat.textType

          ExportFormat.xml

           

          Which type for EPub[Digital Editions]...?

          • 2. Re: Export Epub in InDesign CS5
            csm_phil Level 4

            Hi Ovi,

             

            You will use this js line;

             

             

            #targetengine "digital editions"
            OEBExportMenuItem.exportDocuments(app.activeDocument);

             

            thx

            csm_phil,

            • 3. Re: Export Epub in InDesign CS5
              Oviya... Level 1


              var fileNam = app.activeDocument.name
              fileNam = fileNam.replace(".indd",".epub");   

               

              var myEpub = new File(FilePath+fileNam);               
              app.activeDocument.exportFile(ExportFormat.pdfType,myEpub,false,undefined);

               

              I am trying code like this... In this where I have to add your line...?

              • 4. Re: Export Epub in InDesign CS5
                Oviya... Level 1

                Very Urgent Friends...


                If anybody help me Java script code for export ePub.....

                • 5. Re: Export Epub in InDesign CS5
                  Kasyan Servetsky Level 5

                  This feature is implemented via scripting so you can't export it as usual. Read this thread — it may help you to solve your problem.

                   

                  Kas

                  • 6. Re: Export Epub in InDesign CS5
                    Laubender Adobe Community Professional & MVP

                    And that will change to "normal" scripting in InDesign CS5.5.
                    See Marc Autrets "en_ID-CS55-DOM-WhatsNewObjects.pdf", page 12 at www.indiscript.com.

                     

                    Uwe

                    • 8. Re: Export Epub in InDesign CS5
                      Green4ever Level 3

                      Try this post.....

                       

                      http://forums.adobe.com/message/1924584#1924584

                       

                      I have copied the code from  this post.... Check is this helpful for you...

                      app.scriptPreferences.version = 5.0;
                      var outputFile = File("D:\\test.xhtml"); 
                      var document = app.activeDocument;
                      
                      var scriptPath = Folder.startup + '/Scripts/Export as XHTML/'; 
                      var scriptFile = File(scriptPath + 'XHTMLExport.jsxbin'); 
                      if (scriptFile.exists) { 
                       scriptFile.open(); 
                       var script = scriptFile.read(); 
                       scriptFile.close();
                       eval(script);
                      
                       var opts = new XHTMLExportOptions(); 
                      
                       opts.styleHandling = XHTMLExportOptions.extStyleSheet; 
                       opts.styleSheet = 'template.css';
                      
                       opts.formatted = true; 
                      
                       app.exportForWebPreferences.gifOptionsInterlaced = true;
                      
                       var exporter = new XHTMLExporter(scriptFile);
                      
                       var success = exporter.doExport(document, undefined, opts, outputFile);  // check the results: 
                       if(success)
                       { 
                       /*if(exporter.outOfDateLinks.length > 0) 
                       { 
                       alert('Exporting ' + document.name + ' succeeded\nHowever ' + exporter.outOfDateLinks.length + ' links were out of date.'); 
                       } */
                       }
                       else
                       { 
                       alert('Exporting ' + document.name + ' failed with this error message:\n' + exporter.error.message); 
                       }
                      }
                      
                      

                      ---------

                      Green4ever

                      • 9. Re: Export Epub in InDesign CS5
                        Oviya... Level 1

                        Hi All,

                         

                        I have copied the code which i had tried in InDesign CS5 java script for export Epub..

                        But I got the error as "Uncaught Javascript Exception Cannot Export ABCD.indd" and "Interpreter: CS3 (5.0)".

                         

                        Please give solution friends........

                         

                        //---------------------------------------------------------------------------------------- ------------------------------

                        function digitalEditionsExport()
                        {
                            app.scriptPreferences.version = 5.0   

                         

                            var outputFile = File("/Desktop/18042011/ABCD.epub");
                            var documentToExport = File("/Desktop/18042011/ABCD.indd");
                           
                            var source = app.open(documentToExport, false);       
                            var scriptFile = File("/Adobe InDesign CS5/Scripts/XHTML For Digital Editions/OEBExport.jsxbin");
                           
                            if (scriptFile.exists)
                            {
                                scriptFile.open();
                                var script = scriptFile.read();
                                scriptFile.close();       
                               
                                eval(script);   
                               
                                var xhtmlscript = File("/Adobe InDesign CS5/Scripts/Export As XHTML/XHTMLExport.jsxbin");
                                xhtmlscript.open();
                                var otherScript = xhtmlscript.read();
                                xhtmlscript.close();
                                eval(otherScript);
                           
                                var opts = new OEBExportOptions();
                               
                                opts.imageConversion = ImageConversion.automatic;
                                opts.gifOptionsPalette = GIFOptionsPalette.adaptivePalette;
                                opts.jpegOptionsQuality = JPEGOptionsQuality.medium;
                                opts.jpegOptionsFormat = JPEGOptionsFormat.baselineEncoding;
                               
                                   
                                app.exportForWebPreferences.gifOptionsInterlaced = true;       
                                var exporter = new OEBExporter("/Adobe InDesign CS5/Scripts/XHTML For Digital Editions/","ABCD", undefined);               
                                var success = exporter.doExport(source, opts, outputFile);
                                       
                                if(success)
                                {   
                                    if(exporter.outOfDateLinks.length > 0)
                                    {
                                        alert("Exporting " + document.name + " succeeded\nHowever " + exporter.outOfDateLinks.length + " links were out of date.");
                                    }
                                }
                                else
                                {
                                    alert("Exporting " + document.name + " failed with this error message:\n" + exporter.error.message);
                                }       
                            }   
                            source.close(SaveOptions.no);
                            return success;
                        }

                         

                        var result = digitalEditionsExport();
                        var message = "Digital Editions Export ";
                        message += result?"did ":"did not ";
                        message += "export the file.";
                        message;

                        //---------------------------------------------------------------------------------------- --------------------------------------------

                        • 10. Re: Export Epub in InDesign CS5
                          Oviya... Level 1

                          Right script for Export Epub

                          ----------------------------------------

                           

                          function digitalEditionsExport()
                          {

                              var outputFile = File("/Desktop/18042011/ABCD.epub");
                              var documentToExport = File("/Desktop/18042011/ABCD.indd");
                             
                              var source = app.open(documentToExport, false);       
                              var scriptFile = File("/Adobe InDesign CS5/Scripts/XHTML For Digital Editions/OEBExport.jsxbin");
                             
                              if (scriptFile.exists)
                              {
                                  scriptFile.open();
                                  var script = scriptFile.read();
                                  scriptFile.close();       
                                 
                                  eval(script);   
                                 
                                  var xhtmlscript = File("/Adobe InDesign CS5/Scripts/Export As XHTML/XHTMLExport.jsxbin");
                                  xhtmlscript.open();
                                  var otherScript = xhtmlscript.read();
                                  xhtmlscript.close();
                                  eval(otherScript);
                             
                                  var opts = new OEBExportOptions();
                                 
                                  opts.imageConversion = ImageConversion.automatic;
                                  opts.gifOptionsPalette = GIFOptionsPalette.adaptivePalette;
                                  opts.jpegOptionsQuality = JPEGOptionsQuality.medium;
                                  opts.jpegOptionsFormat = JPEGOptionsFormat.baselineEncoding;
                                 
                                     
                                  app.exportForWebPreferences.gifOptionsInterlaced = true;       
                                   var exporter = new OEBExporter("/Adobe InDesign CS5/Scripts/XHTML For  Digital Editions/","ABCD", undefined);               
                                  var success = exporter.doExport(source, opts, outputFile);
                                         
                                  if(success)
                                  {   
                                      if(exporter.outOfDateLinks.length > 0)
                                      {
                                           alert("Exporting " + document.name + " succeeded\nHowever " +  exporter.outOfDateLinks.length + " links were out of date.");
                                      }
                                  }
                                  else
                                  {
                                      alert("Exporting " + document.name + " failed with this error message:\n" + exporter.error.message);
                                  }       
                              }   
                              source.close(SaveOptions.no);
                              return success;
                          }

                           

                          var result = digitalEditionsExport();
                          var message = "Digital Editions Export ";
                          message += result?"did ":"did not ";
                          message += "export the file.";
                          message;

                          • 11. Re: Export Epub in InDesign CS5
                            Oviya... Level 1

                            Thanks a lot Green4ever.............

                            • 12. Re: Export Epub in InDesign CS5
                              Velprakash Level 1

                              Hi Ms. Oviya,

                                      I used your above codes to export ePub. But I'm getting an error. It's shown  below. Plz have a look at it.

                               

                              error.bmp

                              Even I looked for swf_template.html file in resources. It's there. But I can't guess abt the error. Can Any Expertise Advice..

                               

                              Thanks and Regards,

                              Vel.