0

i have a Indesign CS5 document.
In the middle is a table, which is filled by my java code, than it's pushed to our Indesign.

My code looks like this:

StringBuffer table = new StringBuffer();
int tableSize = 10;
table.append("<Tabelle xmlns:aid5='http://ns.adobe.com/AdobeInDesign/5.0/' xmlns:aid='http://ns.adobe.com/AdobeInDesign/4.0/' aid:table='table' aid:trows='" + tableSize +"' aid:tcols='5' aid5:tablestyle='anhang'>");

.....

table.append("<Zelle aid:table='cell' aid:crows='1' aid:ccols='1' aid5:cellstyle='tb-right'  aid:ccolwidth='65.0'>" + count + "</Zelle>");
table.append("</Tabelle>");

Eveything is working, everything looks like it should, but: aid5:cellstyle='tb-right' is not formating the cell flush right.

Where do i define the style for tb-right? And how it has to look like?

Joergi
  • 1,527
  • 3
  • 39
  • 82

1 Answers1

1

The aid5:cellstyle attribute refers to an InDesign cell style. Cell styles are an InDesign feature - the cell style has to be defined inside the InDesign document the you will import this XML to.

Additionally, to get the text right justified, you'll have to define a paragraph style which does that, and then refer to that paragraph style in your cell style.

All of this can be done manually in InDesign. If you want to programatically define paragraph and cell styles, there are a number of ways to do that, the easiest being through JavaScript. Here's the official Adobe scripting guide for CS5.