Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Export Epub in InDesign CS5

New Here ,
Apr 15, 2011 Apr 15, 2011

Hi Friends,

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

Thanks,

Divya.

TOPICS
Scripting
4.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 15, 2011 Apr 15, 2011

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]...?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 15, 2011 Apr 15, 2011

Hi Ovi,

You will use this js line;

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

thx

csm_phil,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 15, 2011 Apr 15, 2011


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...?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 15, 2011 Apr 15, 2011

Very Urgent Friends...


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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 15, 2011 Apr 15, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 15, 2011 Apr 15, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2011 Apr 15, 2011
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 18, 2011 Apr 18, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 18, 2011 Apr 18, 2011

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;

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 18, 2011 Apr 18, 2011

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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 18, 2011 Apr 18, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 13, 2013 Feb 13, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines