Copy link to clipboard
Copied
Hi Friends,
How can i export epub[Digital Editions] in InDesign CS5 java script...?
Thanks,
Divya.
Copy link to clipboard
Copied
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]...?
Copy link to clipboard
Copied
Hi Ovi,
You will use this js line;
#targetengine "digital editions"
OEBExportMenuItem.exportDocuments(app.activeDocument);
thx
csm_phil,
Copy link to clipboard
Copied
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...?
Copy link to clipboard
Copied
Very Urgent Friends...
If anybody help me Java script code for export ePub.....
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
FYI, it's actually indiscripts with an "s". Link: http://www.indiscripts.com/post/2011/04/so-what-s-new-in-indesign-cs5-5-scripting-dom
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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;
//------------------------------------------------------------------------------------------------------------------------------------
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
Thanks a lot Green4ever.............![]()
Copy link to clipboard
Copied
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.

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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now