Insert data programmatically into an InDesign document

I need to use Adobe InDesign to create documents. Basically, we need to have a couple of variables throughout the document (company name, project name, etc.) that need to be filled out.

I was wondering if there is a way to take the exisitng template and possibly fill them out progmatically using the language that I am comfortable with (Ruby, Python, etc.). I tried to open the Adobe InDesign file using a text editor, but when I make changes using Notepad ++ and then open the file in InDesign, it tells me that the file is damaged.

If you have an understanding with programmatically creating InDesign documents or getting to know any tutorials that would be much appreciated.

PS. I tried to test Adobe ExtendScript, but did not find much documentation related to InDesign.

Thanks for the help!

+6
source share
3 answers

There is no (legal) way to do this in Ruby / Python. Theoretically, you can edit InDesign documents directly using any language, but:

  • It’s not as simple as making some text changes, you’ll have to learn more about the format and
  • This direct violation of the InDesign license agreement means that you may face legal action if Adobe finds out.

ExtendScript is perfect for doing small things like this. If you open the ExtendScript Toolkit and set the InDesign target, you can easily browse and search the entire API. Finding / replacing simple text variables is not at all difficult.

An alternative would be to export documents to the .idml language, which is simpler and legal for editing outside InDesign.

+2
source

You can use the DataMerge function for Indesign -> https://helpx.adobe.com/indesign/using/data-merge.html

I think this is exactly what you are looking for.

Or you can use the Indesign API. Take a look at the Extendscript-Toolkit, especially the ObjectModell-Viewer.

+1
source

You need to convert your .indd file to .idml and unzi. In / Stories / Story _ *. Idml you can find all text variables. And there are no easy ways to change text variables in .indd without Adobe products.

0
source

Source: https://habr.com/ru/post/896909/


All Articles