I’m working on IDML file automation. My requirement is to showcase an IDML template in an HTML5 editor.
I have a simple TextFrame
with Hello World text. I saved the file as: sample.idml
. Then, I unzipped sample.idml
and got a few files. Went to the stories
folder and opened: story_d8.xml
.
Since I’m a developer, I did this using Java and exposed the file path as a REST call. The biggest stopping point is: the jQuery/AngularJS script is saying: invalid file.
Can someone suggest options to address the points below:
Get
Content
data using JavaScript (jQuery/AngularJS)Put "Demo Hello" in the
Content
and regeneratestory_d8.xml
(using JavaScript)Is this the correct approach? Are there alternative to this approach?
Old question but I'll answer it for others.
A1) It's plain XML, so you should be able to just stream it out like any other file. Once you get it, you'll need to parse it using jquery. Then you can walk the tree and find the node you are looking for. If you only have one node in each story file, then you could just parse it out yourself using a regular expression. But it sounds like you don't want all of it on the client, just the data in certain fields - so just let Java parse the data out and just send it to the client app.
A2) You could update the XML using JavaScript, but you are going to have to send it back to the midtier in order to save it back into the IDML file anyway, so I'd just send the data to the server and let the server handle it. Java would be fine for that.
A3) Well, without knowing exactly what you are trying to accomplish, I would suggest doing everything you can server-side. You mentioned needing to provide an "HTML5 Editor" for IDML files. That, in itself, is a huge request to do it from scratch, although it is possible. I would suggest you look at one of the several products out there that can maintain IDML files via a web page (using a Flash/Flex client)
A few (very expensive) examples of 3rd party products you can use maintain/view IDML online, could be Adobe InDesign Server SDK or NXPublisher.
My project was to create IDML files based on IDML templates from data someone entered into a webpage. I handled it like this:
I'd be interested to know what your solution was. But if anyone knows of a cheap solution to view/edit IDML online (especially using an HTML5 client) I'd sure like to hear about it. ;)