Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Rocky@,
IDML is an open format so you need to read/understand the format specification and then do the translation to HTML as desired. Since IDML is just a bunch of XML files you could use any laguage like JS, Python etc to parse those XML files get the information relevant to you and then write the logic to use that information to create HTML files. It is a tedious process but not that complex.
-Manan
Copy link to clipboard
Copied
Is it possible to convert with out Indesign application?
Copy link to clipboard
Copied
Yes absolutely, as I said IDML is a bunch of XML files. Read the specification so that you know where to look for which information, then parse the files, get the information you need and create HTML accordingly.
-Manan
Copy link to clipboard
Copied
Yes, by reading it as XML and converting, structure by structure, to HTML.
But ID could do it in five minutes. Open the IDML, export to HTML. Done. Can you find a workstation to use, or have a collaborator do this for you? It's like, five minutes and a small gift vs. uncounted hours of code translation.
Copy link to clipboard
Copied
Hi @James GiffordāNitroPress,
The charm behind this way of avoiding InDesign is to use other technolgies which might be needed to integrate into an already existing workflow, we also save license cost of InDesign. For ex. I once worked with a vendor who had their own solution to show creatives on the web, they then wanted to integrate the rendering of INDD files into that solution, for that they started with a IDML file, and that was parsed/converted into a JSON that their solution understood and then the reverse of edited JSON to IDML was done. All of this avoided InDesign installation and could be done in their existing tech stack of nodejs
-Manan