-1

How to convert indesign to html using indesign javascript?

Padmashree
  • 7
  • 1
  • 4

3 Answers3

1

I'm assuming that you want to do with scripting what you would do by going into File > Export for > Dreamweaver... If that's the case, then apparently you need to dip into a script called Export as XHTML. According to this thread, "This feature is implemented via scripting so you can't export it as usual." It would seem that ePub is in the same boat.

I'm still relatively new to Stack Overflow so I don't know what the proper etiquette is here. I could copy/paste from the page where I found the answer or I could just link you to it.

This was written for CS3 but I removed the first line and it worked fine in CS5.

What I'm about to link to is a bit over my head, but this PDF might provide you with more information about using Export as XHTML. If you get the SDK you should be able to dig into its source code.

Beyond that, the only thing I was able to find in the Object Model Viewer was ExportForWebPreference. This will help you fine-tune your export settings.

Hope this helps!

Brendan
  • 868
  • 1
  • 16
  • 38
  • @Padmashree This reply from Brendan is the closest you can get with your question. Scripting with adobe looks hard, but once you get your first lines working, it will turn out to be very simple. I recommend you also look at object model, in Adobe Extended Toolscript -> Help -> Object Model, and then select the InDesign Model. It's relatively easy to work with. – João Dias Aug 14 '12 at 13:29
  • @João Dias--- I used the same method and got the result :) – Padmashree Aug 17 '12 at 03:26
1

You are really not being specific enough to answer this question fully. We really need to know what you are trying to export. InDesign has pretty powerful features built in for exporting to HTML.

CS5.5 and CS6 also have a new feature Edit all Export Tags in the Paragraph and Character styles panel. You can map your existing paragraph/character styles to HTML tags and classes.

You can also create an XML structure within InDesign using HTML tags. You can use the Tags and the Structure panels to apply the XML/HTML structure to your layout. Then export the content using the Export XML feature. Change the file extension to .HTML and voila, you have a fully formed HTML file from InDesign.

If you have a specific requirement or a specific file in mind, I could give you more help.

Jim Maivald
  • 522
  • 6
  • 26
0

The following javascript (saved to a .jsx file which is used by InDesign) will do it:

app.activeDocument.exportFile(ExportFormat.HTML, 'c:\\temp\\example.html');
John5000
  • 108
  • 1
  • 7