Convert idml file into HTML
Hello everyone,
Im currently working to convert the idml file into html and try to fix this via automation. And tried with some extendscript code
Main();
function Main() {
// Check to see whether any InDesign documents are open.
// If no documents are open, display an error message.
if (app.documents.length > 0) {
var myDoc = app.activeDocument;
// Build the filename
var myDocName = decodeURI(myDoc.fullName);
var myDocBaseName = myDocName.substring(0, myDocName.lastIndexOf("."));
// Export the page to FXL HTML
with (myDoc.htmlFXLExportPreferences) {
// HTMLRangeFormat = PageRangeFormat.EXPORT_ALL_PAGES
HTMLRangeFormat = PageRangeFormat.EXPORT_PAGE_RANGE
// HTMLPageRange = "1-2";
}
myDoc.exportFile(ExportFormat.HTMLFXL, new File(myDocBaseName + ".html"), true);
}
else {
// No documents are open, so display an error message.
alert("No InDesign documents are open. Please open a document and try again.")
}
}My requirement is to convert the idml file into HTML without formating and it has run in the background means which is helpful, some of the users haven't Indesign Application.
I have checked with different languages ie., NodeJS, python, C# and not get any solution. Please anyone done this before share your idealogy and apporoach to proceed further.
Thanks
