Sie sind auf Seite 1von 30

Working with INX file format

Solutions Document #10091


Version InDesign CS2 / InCopy CS2
08 Nov 2005

ADOBE SYSTEMS INCORPORATED


Corporate Headquarters
345 Park Avenue
San Jose, CA 95110-2704
Working with INX file format

Copyright 2005 Adobe Systems Incorporated. All rights reserved.


The information in this document is furnished for informational use only, is subject to change without notice, and should not be construed as a
commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies that
may appear in this document. The software described in this document is furnished under license and may only be used or copied in accordance
with the terms of such license.
Adobe, Adobe logo, Adobe Acrobat, Adobe InCopy, Adobe InDesign, Adobe Type Manager, and PostScript are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States and/or other countries. Macintosh and Mac OS are either registered trademarks or
trademarks of Apple Computer, Inc. in the United States and/or other countries. Microsoft, Windows, and Windows XP are either registered
trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. All other products or name brands are trademarks
of their respective owners.

Revision Date Author Comments

1.0 6/03/04 Shengliu Dai initial documentation

1.1 3/15/05 Rodney Cook CS2 revisions

1.2 11/8/05 Todd Kopriva Editing


Contents

Getting started with INX file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5


Introduction to the INX file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Overview of the INX file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Understanding the INX file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Hierarchy of objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Order of objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Custom export and import of INX files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Interpreting INX file content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
INX file header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Element and attribute names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Processing object references. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Decoding an element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Simple text content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Special characters in text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Text attributes in stories and table cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Marker processing instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Table attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Alternative double and unit representations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Alternative date and time representation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
List type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Encoded block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
ScriptID values used only in the INX file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Enumerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Appendix A: Attribute values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
EBNF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Non-terminals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Terminals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Appendix B: Objects with ordered children . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Spread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

iii
Contents

Story . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

iv 08 Nov 2005 Working with INX file format


Working with the INX file format
Getting started with INX file format

Working with the INX file format

Getting started with INX file format


This document provides information about the InDesign Interchange (INX) file format and
how to read and understand INX files. This document covers the structure of the INX file, the
algorithm to decode any object within the file, and processing instructions for some special
content of the file. The appendixes provide a list of scripting IDs that are used in Save Back-
wards but are not documented in the Scripting Reference, the formal semantics of attribute val-
ues, and a list of objects that require special ordering of their children.
Before you begin, you must have the following:
z A basic understanding of XML
z A basic understanding of Adobe InDesign, InDesign scripting, and the InDesign scripting
document object model (DOM)
z Access to the Adobe InDesign Scripting Reference
z A copy of the ScriptID value-name lookup table (At least, you should have a copy of Script-
ingDefs.h.)

Introduction to the INX file format

Overview of the INX file format


INX is an XML-based format used to serialize and deserialize the InDesign scripting DOM.
This format is most useful with the Save Backwards feature of InDesign, which allows you to
use an earlier version of InDesign to open a document that was created in a later version of
InDesign. InCopy and GoLive also use the INX format. Each of these usages has a different set
of valid elements and attributes; this document addresses only the elements used in the Save
Backwards feature. However, concepts introduced here also apply to other situations.
In the InDesign scripting DOM, every InDesign document is described by a tree structure of
scripting objects, rooted at a Document object. For example, a document has several children
that are Color objects, several children that are Spread objects, and so on. Besides having chil-
dren, each object can have a set of properties. A Color has properties that describe its name,
color model, and color values, among other things.
When an InDesign document is exported to an INX file, every object, its properties, and their
values are translated into XML. When an INX file is imported, this information is used to cre-
ate a new InDesign document.

Working with the INX file format 5


Working with the INX file format
Introduction to the INX file format

Exporting an InDesign CS2 document as INX data and then importing the INX data into the
same version of InDesign CS2 exactly recreates the original document. Importing the INX data
into an earlier version (e.g., InDesign CS) requires the Save Backwards feature. Exporting and
importing fragments of documents enables the asset libraries, actions, and InCopy stories fea-
tures, and possibly other features.
When a document is saved in INX format as part of a Save Backwards operation, an entirely
new InDesign document is created from the INX data. Because of differences between versions
of InDesign, the resulting document may not look exactly like the original. For example, differ-
ences in the composition algorithm may cause slight differences. The new INX file may contain
objects or object properties that did not exist in the earlier version of InDesign; these objects
and properties are ignored during import into the earlier version of InDesign.

Understanding the INX file format


Because an INX file is the serialized state of a DOM tree and a files content depends on what is
in the tree, there is no formal definition or static description for INX files. This is a necessary
feature of the INX technology; because INX is based on the scripting DOM, and the DOM is
extensible by third-party plug-in developers, it follows that any plug-in developers can have
their data represented in INX simply by including appropriate scripting support for their fea-
tures. Of course, this does make creating and parsing INX files more difficult.
Each INX file begins with a standard XML declaration. The next line is an INX-specific pro-
cessing instruction (PI), which might be followed by additional processing instructions. Next
comes the outermost (root) XML element document (docu), which represents the Document
object in the scripting DOM. (For uses other than Save Backwards, such as assignment, the
outermost element may be something other than Document.) Everything else is either a child
of the root element, or a child of a child.
Each scripting DOM object is represented by an XML element. Each object property becomes
an XML attribute.
Element and attribute names are identified by ScriptID values.
Property values are constrained by the rules of what can or cannot appear in an XML attribute
value string. Moreover, property values can be complex types, including heterogeneous lists
and lists of lists. See Appendix A: Attribute values on page 26.

Hierarchy of objects
An INX file is usually large and consists of obscure-looking codes, so it appears to be compli-
cated. However, the INX file structure is simple. To get an impression of what an INX file looks
like do the following:
1. In InDesign, open a very simple InDesign document. (An empty document will suffice for
this exercise.)
2. Export the document to INX format by choosing File > Export and selecting InDesign
Interchange.

6
Working with the INX file format
Introduction to the INX file format

3. Open the file in a text editor, such as Notepad, Visual Studio, or an XML editor such as
XMLSpy.
The hierarchical scripting document object model is exactly the same as the InDesign scripting
DOM. Compared to the legacy scripting view, there are only a few differences:
z A few new objects store information for facilitating the processing of INX (such as the
InsertionPoint object).
z A few attributes are added and a few are removed to improve the performance of INX file
export and import.
z Scripting events are not relevant to INX.

Order of objects
Inside the document object, its first-level (direct) child objects are listed one by one, indented
by one tab character. The documents preference objects are listed first; followed by more visi-
ble content, such as layers, master spreads, spreads, sections, XMLStory, stories, and so on; the
final part contains other objects.
In general, children appear in the same order as in the scripting DOM. You can regard this as
random order; in other words, do not assume that objects will occur in any particular order.
However, there are several special cases in which the children do occur in a certain order. In the
case of the document object itself, its children are sorted. For a list of objects whose children
are placed in a certain order and their respective algorithms, refer to Appendix B: Objects with
ordered children on page 29.
NOTE: The order of the children might change at any time. Do not reorder the objects; doing
so could cause problems because certain objects require that others be created first.

Custom export and import of INX files


Usually, third-party plug-in developers dont need to implement custom export and import of
INX files. Even if you have custom persistent data in your plug-in, as long as you provide
scripting support for your data, the InDesign or InCopy application will export or import these
data for you. But if you do have to write custom code to export or import these files, be aware
that for InDesign CS2 and InCopy CS2 you need to send NewDocResponder signals and
OpenDocResponder signals; this may change in a future version of InDesign and InCopy. The
responses to NewDocRepsonder and OpenDocResponder signals sometimes share similar
code (typically attach document observers). To minimize the impact of possible future change,
it is recommended that you check in your OpenDocResponder to see whether a corresponding
NewDocResponder has already been executed.

Working with the INX file format 7


Working with the INX file format
Interpreting INX file content

Interpreting INX file content

INX file header


The first line of an INX file is a standard XML declaration that looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
The next line is an INX-specific processing instruction. It contains information required by
InDesign to properly configure the import process. Here is an example:
<?aid style=33 type="document" DOMVersion="4.0" buildNumber=225 featureSet="257"
?>
TABLE 1 INX head settings

Element Description

aid Reserved token that InDesign uses for its INX-processing instructions.

style Identifies style, which is set forth for various INXOptions, 33 = 0x21, which
represents InDesign CS2, use Readable numbers.

type Identifies the intended use of this INX file. INX files that serialize the state of an
InDesign document are of type document.

DOMVersion Identifies the version of the scripting DOM that was used to export the file.
Currently, there are two possible values: 1 for InDesign CS and 4.0 for InDesign
CS2.

featureSet Identifies the scripting DOM feature set that was used during export. This value is
either 256 for the Roman feature set or 257 for Japanese.

Element and attribute names


InDesign writes four-character ScriptID values to INX files. The following table shows exam-
ples of the ScriptID names and ScriptID values for a few common elements.
TABLE 2 ScriptID names and ScriptID values

ScriptID names ScriptID values

Document docu

Color colr

Spread sprd

Story cflo

TextStyleRange txsr

Item Geometry IGeo

8
Working with the INX file format
Interpreting INX file content

Because the names are derived directly from the scripting DOM, you can refer to the InDesign
Scripting Reference to learn about the meaning of each object, property, and property value.
NOTE: Some attribute and element names, such as Item Geometry, are used only in INX and
are not documented in the Scripting Reference. See ScriptID values used only in the
INX file format on page 14 for details.

Processing object references


In the scripting DOM, some objects are children of other objects, and some objects point to
other objects. For example, a paragraph style contains a property that points to its parent style.
INX represents these pointers by assigning a unique Self attribute to each element. The specific
value is not important. What is important is that each value is a string that is unique within the
INX file.
A property that points to another object (an object reference) has a value of type Object. There
may, of course, be many references to the same object.
NOTE: INX files can contain forward references.
Pointers from one file to another are not possible. In this sense, INX behaves like href/id rather
than like xpointer.
Here is a simplified example of a Tint that is based on a Color. In this example, the colors Self
value is the string ue. It is referenced by the tints clbs (Base Color) attribute:
<colr clmd="e_prss" clsp="e_CMYK" clvl="x_4_D_75_D_5_D_100_D_0" ovrd="e_norm"
clbs="o_n" pnam="c_C=75 M=5 Y=100 K=0" edbl="b_t" rmbl="b_t" pvis="b_t" ptag="c_"
Self="c_ue"/>
<tint tntv="D_68" clmd="e_prss" clsp="e_CMYK" clvl="x_4_D_75_D_5_D_100_D_0"
ovrd="e_norm" clbs="o_ue" pnam="c_C=75 M=5 Y=100 K=0" edbl="b_t" rmbl="b_t"
pvis="b_t" ptag="c_" Self="c_u90"/>
Some facts about object references:
z The value of the objects Self attribute and the reference value in other objects properties are
guaranteed by using the same routine when exporting to an INX file.
z There can be zero or more references that point to the same object.
z The identifier must be unique throughout the document. The actual value is not important;
it can be any value as long as it maintains uniqueness. (Tip: If you change the identifier,
remember to change all references to it.)

Decoding an element
An element is represented as its attributes and children. Here is an example of a gradient ele-
ment with two child elements:
<grad grdt="e_axlg" pnam="c_" edbl="b_t" rmbl="b_t" pvis="b_f" ptag="c_"
Self="rc_u7b">
<gstp gcls="o_u7c" loca="D_0" Self="rc_u7bgstp0"/>
<gstp gcls="o_u8" loca="D_100" mids="D_50" Self="rc_u7bgstp1"/>
</grad>

Working with the INX file format 9


Working with the INX file format
Interpreting INX file content

Each element, whether parent or child, expresses the following:


z The objects name, represented by its ScriptID value, which is the four-character XML tag
(for example, <grad ....>). To find the full ScriptID name and description of the object, look
it up in the value-name lookup table. For example, grad represents gradient.
z A list of attributes of the form scriptIdValue=type_value; for example, grdt=e_axlg or
loca=D_0. See Table 3.
TABLE 3 Interpreting an ID value pair

scriptIdValue Represents the property name of the attribute. Look it up in the value-name lookup
table. For example, grdt is the gradient type.

type The type of the value. Look it up in Terminals on page 27. For example, rc
represents two aspects of the type, a Read_only (r) attribute of type Type_string;
whereas e indicates a type of Type_enum.

value The value of the attribute. The value is represented by the characters after the
underscore (_) character. For example, D_100 represents a Double valued 100.00; b_t
represents a Boolean with the value of true; o_u7c represents an object reference with
identifier u7c. If the type is Type_enum, then look up its ScriptID value in the value-
name lookup table; for example, e_axlg represents an enumeration of type Linear.

Attributes values can contain subvalues; for example, a list containing items. For this, recur-
sively analyze each item as shown in Table 3. For each child element, recursively interpret the
element and its attributes. By such recursive analysis, you can translate each plain, static XML
element and attribute to dynamic, structured scripting DOM objects and properties.

Simple text content


Text is contained in a Contents element (ScriptID value pcnt) that is a child of a Text Style
Range element (ScriptID value txsr). Each Text Style Range has exactly one Contents child.
Textual content is broken into ranges that share a common set of text attributes. The Text Style
Range defines the attributes to apply to the text. So, a simple range of text might look like this:
<txsr prst="o_u51" crst="o_u52" ptsz="U_14" font="c_Arial">
<pcnt>c_Hello world.</pcnt>
</txsr>
The contents of the Contents element is in serialized form. The leading c_ indicates that the
contents are expressed as a string.

Special characters in text


Text may contain any characters, including special characters that InDesign and InCopy sup-
port. However, some characters are not allowed in a well-formed XML document. These char-
acters are encoded in an ACE processing instruction so that the data can correctly make the
round trip from an InDesign native document to INX format and back again. In the example
below, <?ACE 18?> represents the Auto Page Number special character.
<pcnt>c_Hello world<?ACE 18?>.</pcnt>

10
Working with the INX file format
Interpreting INX file content

The characters disallowed from a well-formed XML document are as follows (values in hexa-
decimal):
z 0x0000-0x0008
z 0x000B
z 0x000C
z 0x000E-0x001F
z 0xD800-0xDFFF
You can compare ACE values to those found in TextChar.h. For example, <?ACE 4?> represents
Footnote Marker; <?ACE 19?> represents Section Marker.
NOTE: This special treatment is common for INX and XML.

Text attributes in stories and table cells


One or more Text Style Range elements make up the textual contents of a Story (cflo) or a Table
Cell (ccel) element. There are many text attributes that can be applied to a Text Style Range.
You will not see the values of each attribute written out for each Text Style Range. Rather, you
will see a reference to Paragraph Style (psty) and Character Style (csty) elements. The Text Style
Range object inherits its attribute values from its styles. If an attribute value is overridden, it
appears as an attribute of the Text Style Range. Attributes not explicitly defined for the Text
Style Range are assumed to come from the underlying styles.
Character and paragraph styles are hierarchical. Each style is based on another style and
defines only the attributes that differ from its parent style. At the bottom of the hierarchy are
the base character and paragraph styles. These are identified by the lack of a based-on (basd)
attribute value.
To properly apply text attributes, do the following:
1. Apply the paragraph style.
2. Apply the character style.
3. Apply any overrides.
Refer to the Scripting Reference to gain an understanding of all of the possible text attributes
and their values.

Marker processing instruction


Sometimes you need to be able to refer to a location between two characters in a story. Con-
sider this example:
<txsr prst="o_u51" crst="o_u52" ptsz="U_14" font="c_Arial">
<pcnt>c_Text with <?aid Self="rc_ua0cinsc"?>inline graphic.</pcnt>
</txsr>
The processing instruction (?aid) in the middle of the text is an insertion point marker.

Working with the INX file format 11


Working with the INX file format
Interpreting INX file content

Recall from the discussion of object references that a Self property serves as the target for
object-to-object references. Recall also that the value of the property is unimportant; it is sim-
ply a string that is guaranteed to be unique within the INX file.
In the preceding example, the text implies that the marker is used to indicate where an inline
graphic should be placed. Elsewhere in the INX file is an element with an attribute that refer-
ences the marker. In effect, the element is saying, Place me here.
Here is what a simple inline rectangle might look like. Some attributes have been removed for
simplicity:
<crec STof="ro_ua0cinsc" flcl="o_u9" Self="rc_ub7">

</crec>
The rectangles Story Offset (Stof) attribute points to the desired location in the text.
There are also other uses for markers. Sometimes they are used in pairs to delimit a range of
text, such as a range of tagged text.

Table attributes
Table cells also have attributes. Do not confuse these with the attributes of the text that the cells
contain. An example of a cell attribute is its stroke style.
Processing cell attributes is similar to processing text attributes. Things are slightly easier
because, as of now, there is only a single base table style. Every table is deemed to have the set of
attributes defined by this style. Every table cell, in turn, inherits this same set of attributes.
Note that, whereas a Text Style Range points to its Paragraph and Character styles, Table and
Cell elements do not. In the future, if generalized table styles are supported, this will change.
To determine the full set of attributes that apply to each table cell do the following:
1. Apply the base attributes values found in the table style (tsty) element.
2. Apply overrides found on the Cell element itself.
NOTE: If you set an attribute on one cell, it does not carry over to another. Each cell starts over
with the attributes defined in the base table style.

Alternative double and unit representations


Real numbers are represented in one of two waysreadable or binarydepending on an
option set using INXOptions during export. Because readable and binary numbers have differ-
ent type codes (D versus d and U versus u), it is theoretically possible to find both in a single
INX file. In practice, however, this does not occur.
To process the readable format, use a good text-to-real conversion algorithm, otherwise, loss of
precision is possible.
The binary format is a direct representation of the bits in an IEEE-754 floating-point value.

12
Working with the INX file format
Interpreting INX file content

Alternative date and time representation


Like real numbers, time stamps can have two different representations, binary and readable:
z The binary representation is a 64-bit unsigned integer that represents the number of 100-
nanosecond intervals since the beginning of January 1, 1601. This is known as FILETIME
on Windows. This value can be processed using the Deserialize64() function.
z The readable representation is as an XML-standard date and time string. It looks like this:
yyyy-mm-ddThh:mm:ss
Note that the dash (-), the character T, and the semicolon (:) are separator characters.

List type
There are three type of lists: General_list, Record_list, and Object_list. Their terminals are x, y,
and z, respectively. See Appendix A: Attribute values on page 26 for formal definitions.
Some list values are quite straightforward to decode, such as the following example:
clvl="x_4_D_0_D_0_D_0_D_0"
In the above example, the attribute value of clvl (color value) is a list type with four items. The
items are of type Type_readable_double, and all have the value 0. That is, the C, M, Y, and K
components are all 0.
Special attention is required for lists, because they are generated dynamically; before a list is
exported to an INX file, you cannot predict how many items the list will have. In addition,
General_list can consist of multiple Simple_value items; thus its items type could be mixed.
For example, the first item could be a double, the second could be a string, the third an enu-
meration, the fourth an object, and so on. The following example describes a page item (rect-
angle):
<crec txwr="ro_uafctxw1" IGeo="x_19_l_1_l_4_l_2_D_353_D_-
317_l_2_D_353_D_165_l_2_D_478_-165_l_2_D_478_D_-317_b_f_D_353_
D_-317_D_478_D_-165_D_1_D_0_D_0_D_1_D_0_D_0" cntt="e_unas"
Xaxn="ro_n" xpSs="D_0" xpSn="D_0" xpVn="D_0" xpBm="e_norm"
xpBo="D_100" xpBk="b_f" xpBi="b_f" xpSm="e_none" xpSb="e_xpMb"
xpSx="D_7" xpSy="D_7" xpSr="D_5" xpSc="o_ua" xpSo="D_75"
xpVm="e_none" xpVw="D_9" xpVc="e_xpCc" ovrp="ro_n" STof="ro_n"
flcl="o_u11" filt="D_-1" ovpr="b_f" lnwt="U_1" mitr="D_4"
endc="e_bcap" endj="e_mjon" stty="o_di5a29" llen="e_none"
rlen="e_none" lncl="o_u8" lint="D_-1" pcef="e_none"
pcrd="D_12" pgst="x_2_U_0_U_0" pgfl="U_0" pgfa="D_0"
pgss="x_2_U_0_U_0" pgsl="U_0" pgsa="D_0" gapT="D_-1"
strA="e_stAC" nopr="b_f" pilr="o_u6c" plck="b_f" pLDs="e_Dflt"
ptag="c_" Self="rc_uaf">

<ctxw pcos="ro_uafctxw1ccos1" txwt="e_none" ptwi="e_none"


ptwv="b_f" IGeo="x_5_l_0_D_0_D_0_D_0_D_0" Self="rc_uafctxw1">

<ccos ptns="rx_0" acpn="rx_0" Self="rc_uafctxw1ccos1"/>


</ctxw>
</crec>

Working with the INX file format 13


Working with the INX file format
ScriptID values used only in the INX file format

IGeo (Item Geometry) of crec (rectangle) is a general list with 25 items (the length is stored in
hexadecimal form after the type terminator, where 0x19 equals 25). It may be difficult to
understand this list until you know the proper structure of the property. Fortunately, the
Scripting Guide describes each property and its possible values. Those few special properties
that are used only when exporting and importing INXsuch as IGeoare documented in
ScriptID values used only in the INX file format on page 14.
NOTE: The documentation attempts to list all possible properties and their variations; however,
sometimes new, undocumented properties are added. When a special value is found, it
should be resolved on a case-by-case basis.

Encoded block
The INX file contains several blocks of ASCII encoding data. Data is encoded because it is
binary and must be encoded to put it into an XML file. There are some exceptions, such as EPS
Text Data.
NOTE: Do not alter the content of any encoded block.

ScriptID values used only in the INX file format

Enumerations
The following enumerations are special to the INX file format. The rightmost two column in
the table describe the possible enumerators.

14
Working with the INX file format
ScriptID values used only in the INX file format

FIGURE 1 Table of enumerations

Enum type Enum Enum Description Enum Enum name


type type ID
name ID
en_EncodingType encoding eten How contents value is ethx hex encoding
type encoded. Value type of eta8 ascii85 encoding
p_BinaryBlobEncoding eta6 ascii64 encoding
property

en_AGMBlackBoxType contents bbte Types of smooth shades bbta axial shade


type persisted. Value type of bbtr radial shade
settings p_AGMBlackBoxType bbtm mesh shade
property bbtc constant shade

en_GridStartingPointType grid Gstp Options for the grid gsto top outside
starting starting point. Value type gsti top inside
point of p_GridStartingPoint gsbo bottom outside
options property gsbi bottom inside
gscv center vertical
gsch center horizontal
gscc center completely
en_Override color eOvr The override type. Value norm normal
override type of p_Override eOvP specialpaper
property eOvB specialblack
eOvR specialregistratio n
eOvH hiddenreserved
eOvM mixedinkparent

Properties
The following table lists the properties that are special to INX. For the purpose of understand-
ing INX, if the storage type is simple, you can assume that the value string in the INX is quite
simple, too (for example, because storage type Long means that the value is a long int, you can
expect the value string to be something like l_12345 and just interpret the result as integer
12345). However, if the storage type is complex (such as an array of arrays of mixed types),
decoding is also more complex. Information on how to decode the specific value strings are
given in Table 4.
NOTE: Some Property IDs represent different Scripting Elements, so their meaning could be
different. Also, to facilitate fast lookup, the table is sorted according to the ScriptID
value.
TABLE 4 Property table

Property ID ScriptID ScriptID Scripting element ID Storage type Comments


name value

p_AllRunInSt All nested alrs kAllRunInStylesPro Array of arrays See p_AllRunInStyles


yles styles pertyScriptElement of ID/value pairs on page 19.

Working with the INX file format 15


Working with the INX file format
ScriptID values used only in the INX file format

Property ID ScriptID ScriptID Scripting element ID Storage type Comments


name value

p_AppliedTO Applied ATOC kAppliedTOCStyleP TOCStyle Reference to TOCStyle


CStyle TOC Style ropertyScriptEleme object
nt

p_BinaryBlob contents bben kAGMBlackBoxEnc EncodingType See enum explanation in


Encoding encoding odingScriptElement enumerator Enumerations on
page 14.

p_AGMBlack contents bbmx kAGMBlackBoxMat Array of six Real Matrix


BoxMatrix matrix rixScriptElement values

p_AGMBlack contents bbtp kAGMBlackBoxTyp ContentsTypeSe See enum explanation in


BoxType type eScriptElement ttings Enumerations on
enumerator page 14.

p_BNBulletC bullet char bnbc kBNBulletCharacter Array of See p_BNBulletChar on


har PropertyScriptElem Bulletcharactert page 20.
ent ype enumerators
or Longs

p_BindingLo binding BnLc kBindingLocationPr Long


cation location opertyScriptElement

p_BaseColor base color clbs kBaseColorProperty Color Object reference to color


ScriptElement type

p_DMDataSo data source dsfl kDataMergeDataSo File A value for the form
urceFile file urceFileScriptEleme f_xxx, where xxx is file-
nt name string of SysFile

p_DMDataSo data source dsft kDataMergeDataSo DataSourceType Enumerators:


urceFileType file type urceFileTypeScriptE enumerator en_DataMergeCommaSe
lement perated, comma-
separated, dmCs;
en_DataMergeTabDelimit
ed, tab-delimited, 'dmTd'

p_Editable color edbl kColorEditableProp Boolean


editable ertyScriptElement

p_EPSTextDa EPS text ETFC kEPSTextDataPrope String Similar to image, stores


ta data rtyScriptElement encoded EPS text data
record

16
Working with the INX file format
ScriptID values used only in the INX file format

Property ID ScriptID ScriptID Scripting element ID Storage type Comments


name value

p_Hyperlink destination hlds kDestinationPropert Array of String, See


Destination yScriptElement Long, or p_HyperlinkDestination
Boolean values, on page 20.
HyperlinkTextD
estination,
HyperlinkPageD
estination,
HyperlinkExter
nalPageDestinat
ion, or
HyperlinkURLD
estination

p_ItemGeom item IGeo kItemGeometryPro Array of Long, See p_ItemGeometry on


etry geometry pertyScriptElement Boolean, or Real page 20.
values

p_InstanceLis instance InLi kIndexInstanceListP Array of strings See p_InstanceList on


t list ropertyScriptEleme or story page 21.
nt references

p_GridStartin grid Jgsp kGridStartingPointP GridStartingPoi See enum explanation in


gPoint starting ropertyScriptEleme ntOptions Enumerations on
point nt enumerator page 14.

p_Mojikumi mojikumi jmus kMojikumiUISettin Short This is a private, Japanese-


UISettings UI settings gsPropertyScriptEle only preference setting.
ment

p_RubyFlag ruby flag jrfg kRubyFlagPropertyS Long This is a private, Japanese-


criptElement only preference setting.

p_UseMaster use master Jumg kUseMasterGridPro Boolean


Grid grid pertyScriptElement

p_ColumnWi column klwd kColumnWidthProp Unit Property of table and table


dth width ertyScriptElement style objects

p_LinkInfo linked file LnkI kLinkInfoPropertyS Array of Strings, See p_LinkInfo on


info criptElement Longs, Dates or page 21.
Booleans

p_CanChoos can choose Mccp kCanChoosePosters Boolean


ePosters posters PropertyScriptElem
ent

p_CustomPos custom Mcsp kCustomPosterProp Boolean


ter poster ertyScriptElement

p_FixedHeigh fixed MFHo kFixedHeightProper Unit Property of table and table


t height tyScriptElement style objects

Working with the INX file format 17


Working with the INX file format
ScriptID values used only in the INX file format

Property ID ScriptID ScriptID Scripting element ID Storage type Comments


name value

p_IntrinsicBo intrinsic Mibd kIntrinsicMovieBou Array of two Store width and height of
unds bounds ndsPropertyScriptEl Long values intrinsic bounds (of movie
ement page item).

p_PosterIsAv poster Mpia kPosterIsAvailablePr Boolean


ailable available opertyScriptElement

p_MixedInkI ink name mxnm kInkNameArrayPro Array of String Ink names


nkNames list pertyScriptElement values

p_Overriden overridden ovpp kOverridenPIProps Array of Long Stores a list of Interface


PageItemProp page item PropertyScriptElem values IDs that are locally
s props ent changed; that is, used in
describing locally
overridden page items.

p_Override color ovrd kColorOverridePro ColorOverride See enum explanation in


override pertyScriptElement enumerator Enumerations on
page 14.

p_OverrideLi override ovrl kOverrideListPrope Array of See p_OverrideList on


st list rtyScriptElement PageItem values page 22.

p_PageCount page count PagC kPageCountPropert Long


yScriptElement

p_AllCellGra all cell pcgl kAllCellGradientAtt Array of Real General list type. First two
dientAttrList gradient rListPropertyScriptE values, arrays of items are length and angle
attr list lement two Unit values of cell gradient, third is a
list with two items, which
are (x, y) coordinates of
gradient center.

p_Contents contents pcnt kContentPropertySc String See p_Content on


riptElement page 22.

p_Contents contents pcnt kImageContentsScri String See p_Content on


ptElement page 22.

p_Contents contents pcnt kAGMBlackBoxCon String See p_Content on


tentsScriptElement page 22.

p_MetaDataP metadata pMep kMetaDataPacketPr MetadataPacket Stores object reference of


acket packet opertyScriptElement Preference kMetaDataPacketObjectS
criptElement object,
which has property of
kContentPropertyScriptEl
ement property.

p_Visible visible pvis kColorVisibleProper Boolean


tyScriptElement

18
Working with the INX file format
ScriptID values used only in the INX file format

Property ID ScriptID ScriptID Scripting element ID Storage type Comments


name value

p_AGMBlack contents pvrs kAGMBlackBoxVers Long


BoxVersion version ionScriptElement

p_Removable color rmbl kColorRemovablePr Boolean


removable opertyScriptElement

p_SpotColorL spot color spcl kSpotListPropertySc Array of Property on


ist list riptElement Swatches kAGMBlackBoxObjectScr
iptElement(c_AGMBlack
Box, "pasted smooth
shade"). Its value is object
list of Swatch.

p_SpecialGly custom SpGl kSpecialGlyphPrope Long No


ph glyph rtyScriptElement

p_StoryOffset story offset STof kPIStoryOffsetProp InsertionPoint See p_StoryOffset on


ertyScriptElement page 23.

p_StoryOffset story offset STof kChangeStoryOffset InsertionPoint See p_StoryOffset on


PropertyScriptElem page 23.
ent

p_StoryOffset story offset STof kStoryOffsetPropert InsertionPoint See p_StoryOffset on


yScriptElement page 23.

p_StoryOffset story offset STof kNoteStoryOffsetPr InsertionPoint See p_StoryOffset on


opertyScriptElement page 23.

p_XMLConte XML Xcnt kXMLContentPrope Text, Story, Stores object reference to


nt content rtyScriptElement PageItem, actual page item
Movie, Sound,
Image, EPS or
PDF

p_AllRunInStyles
Storage type: Array of arrays of ID/value pairs
This property stores a list of all of the properties of all of the nested styles on the object.
Example of the attribute value:
alrs="x_4_z_4_63727374_o_u58_72697465_e_RIdc_72696374_l_1_72696963_b_t_
z_4_63727374_o_u58_72697465_e_RIdw_72696374_l_a_72696963_b_t_
z_4_63727374_o_u58_72697465_e_RIdc_72696374_l_1_72696963_b_t_
z_4_63727374_o_u58_72697465_c_Sentences_72696374_l_8_72696963_b_t"
Applying the algorithm provided in Decoding an element on page 9 to decode the ID/value
pairs for the first example record shown above, you can see the following:
z x_4 indicates a general list type of four items.

Working with the INX file format 19


Working with the INX file format
ScriptID values used only in the INX file format

z z_4 indicates a Record list with four items that represents all properties of a kAllRunInStyle-
ObjectScriptElement.
z 63727374_o_u58 indicates a property of crst/p_AppliedCharStyle on kCharacterStyleProp-
ertyScriptElement, whose value is an object.
z 72697465_e_RIdc indicates a property of rite/p_RunInTriggerExp ("delimiter") on
kTriggerExpressionPropertyScriptElement, whose value is an enum.
z 72696374_l_1_ indicates a property of rict/p_RunInCount ("repetition") on kRunInCount-
PropertyScriptElement, whose value is a long int.
z 72696963_b_t_ indicates a property of riic/p_RunInInclusive on kRunInInclusiveScriptEle-
ment, whose value is a Boolean.
NOTE: This decodes one Record list; you could apply the same method to the other three
records, thereby decoding the whole value string.

p_BNBulletChar
Storage type: Array of Bulletcharactertype enumerators or Long values
INX uses the kBNBulletCharacterPropertyScriptElement to access the kBNBulletCharacter-
ObjectScriptElement objects properties directly, so its value is not a reference to an object;
rather, it is a general list of two items.
An example value:
"x_2_e_BCuf_l_2022"
z x_2 indicates a general list type of two items.
z e_BCuf indicates an enum whose value is BCuf/en_BCUnicodeWithFont. Other possible
values are BCuo/en_BCUnicodeOnly and BCgf/en_BCGlyphWithFont.
z l_2022 indicates a long whose value is 2022.

p_HyperlinkDestination
Storage type: Array of String, Long or Boolean values, HyperlinkTextDestination, Hyper-
linkPageDestination, HyperlinkExternalPageDestination, or HyperlinkURLDestination
The storage type looks complicated, but it actually has only the following three cases:
z If there is no destination indicated, the value is a nil object reference.
z If it is an external destination, then the value is a list of external datalink information, which
stores file name, volume name, DirID, ClassID, and hyperlink destination UID. Except for
the last item, they are the same as p_LinkInfo on page 21.
z If it is a valid internal destination, it stores the object reference to the destination (that is, the
xxxDestination objects).

p_ItemGeometry
Storage type: Array of Long, Boolean, or Real values
p_ItemGeometry is a complex property. It stores geometry information about a page item. Its
value is a list that has mixed value items.

20
Working with the INX file format
ScriptID values used only in the INX file format

An example of the attribute value:


IGeo="x_19_l_1_l_4_l_2_D_36_D_-360_l_2_D_36_D_-175.2_ l_2_D_309.8181818181818_D_-
175.2_l_2_D_309.8181818181818_D_-360_b_f_ D_36_D_360_D_309.8181818181818_D_-
175.2_D_1_D_0_D_0_D_1_D_0_D_0"
The items in the list are can be decoded as follows:
z x_19 indicates a general list type of 25 (0x19) items.
z l_1 indicates that there is a single path. If there were more than one path, the other paths
would be inserted after b_f, which marks the end of a path.
z l_4 indicates the start of a path containing four points.
z l_2 indicates the first point, whose type is 2 (enum PMPathPointType, kL, see PathTypes.h),
which represents a corner point, where only the anchor point itself matters; so the point's
X(), Y() value is appended ("D_36_D_-360"). Note that if the path point type were 0 or 1
(kCS or kCK), then the left and right direction points would be written out, too, so there
would be another four numbers. The same rules apply to the second, third, and fourth
points.
z b_f indicates the end of the single path containing four points, whose Boolean value speci-
fies whether the path is open.
z D_36_D_360_D_309.8181818181818_D_-175.2 indicates the geometric bounds, four dou-
ble values that represent the left, top, right, and bottom of the bounding box.
z D_1_D_0_D_0_D_1_D_0_D_0 indicates the transform matrix, whose six double values
represent the matrix.
z If the item has graphic bounds, an additional four double values represent the left, top,
right, and bottom of the graphic bounding box.

p_InstanceList
Storage Type: Array of strings or story references
z This is a general list that stores names (string) and stories (object reference) of index
instances alternatively (odd-numbered items are names, even-numbered items are stories).
z This is a property of the document object.

p_LinkInfo
Storage type: Array of String, Long, Date, or Boolean values
Stores link information.
An example:
LnkI="x_c_c_C:\shuksan\build\qa\testfile\BOTTLE.TIF_c__l_0_l_8c01_c_TIFF_l_0_c__t_0
~21fd4_t_1c4137a~defef92a_l_0_b_t_b_f"
z x_c indicates a general list type of 12 (0x0c) items.
z c_C:\shuksan\build\qa\testfile\BOTTLE.TIF indicates a string representing the link path
and file name.

Working with the INX file format 21


Working with the INX file format
ScriptID values used only in the INX file format

z c__ indicates a string representing the link Volume, whose value (on Windows) is an empty
string.
z l_0 indicates a long representing the the DirID, whose value (on Windows) is 0.
z l_8c01 indicates a long representing the ClassID, whose value is kDataLinkBoss.
z c_TIFF indicates a string representing the format name.
z l_0 indicates a long representing file type.
z c__ indicates a string representing the datalink full name for Mac OS, whose value (on Win-
dows) is an empty string.
z t_0~21fd4 indicates a 64-bit Type_alt_date representing the file size. The 64-bit value is sep-
arated into two 32-bit values by a tilde (~).
z t_1c4137a~defef92a indicates a 64-bit Type_alt_date representing the file time stamp. The
64-bit value is separated into two 32-bit values by a tilde (~).
z l_0 indicates a long representing the link state, which is (IDataLink::kLinkNormal). For
other possible values, refer to IDataLink.h.
z b_t indicates a Boolean representing the return value of IsLinkNeeded().
z b_f indicates a Boolean representing the return value of HasInternalDataChanged().

p_OverrideList
Storage type: Array of PageItem values
Stores a list of (master page item, layout page item) pairs within the page (because the page
object has this property).
For example:
ovrl="x_6_o_ucc_o_ud6_o_uf6_o_uf9_o_uf4_o_ufb"
z x_6 indicates a general list type of six items.
z o_ucc_o_ud6 indicates a (master page item, layout page item) pair.
z o_uf6_o_uf9 indicates a (master page item, layout page item) pair.
z o_uf4_o_ufb indicates a (master page item, layout page item) pair.

p_Content
Storage type: String
p_Content is also used in other objects where content has a meaningful string, such as the text
content of a story; but for these property elements that are available only in INX, p_Content is
used differently.
z For kImageContentsScriptElement and kAGMBlackBoxContentsScriptElement, p_Content
represents IAsciiEncodingUtils::kAscii64Encoding (or some other encoding type), an
encoded string of image content. Do not modify it directly.
z For kContentPropertyScriptElement, p_Content represents the XML packet representing
the metadata. Its a property of kMetaDataPacketObjectScriptElement (metadata packet
preference). The stored strings are also not encoded.

22
Working with the INX file format
ScriptID values used only in the INX file format

p_StoryOffset
Storage Type: InsertionPoint.
p_StoryOffset represents kPIStoryOffsetPropertyScriptElement, kChangeStoryOffsetProperty-
ScriptElement, kStoryOffsetPropertyScriptElement, and kNoteStoryOffsetPropertyScriptEle-
ment.
The value is an object reference to InsertionPoint. InsertionPoint is a special object that marks
a position inside text. See Marker processing instruction on page 11.

Objects
Table 5 summarizes objects that are available only in INX. Details about their base objects, par-
ent objects, children, and special properties are listed in the following detail sections.
TABLE 5 Objects table

Object ID Name 4-char Scripting element ID


value

c_AGMBlackBox pasted smooth ctbb kAGMBlackBoxObjectScriptElement


shade

c_EPSText EPSText EPST kEPSTextObjectScriptElement

c_XMLStory xml story bnbc kXMLStoryObjectScriptElement

c_MetaDataPacket binding location BnLc kMetaDataPacketObjectScriptElemen


t

c_AGMBlackBox
Base object: swatch, 'swch', kSwatchObjectScriptElement
Parents:
z "application", 'null', kApplicationObjectScriptElement
z "document", 'docu', kDocumentObjectScriptElement
Properties:
z "contents version", 'pvrs', kAGMBlackBoxVersionScriptElement
z "contents type", 'bbtp', kAGMBlackBoxTypeScriptElement
z "spot color list", 'spcl', kSpotListPropertyScriptElement
z "contents", 'pcnt', kAGMBlackBoxContentsScriptElement
z "contents encoding", 'bben', kAGMBlackBoxEncodingScriptElement
z "contents matrix", 'bbmx', kAGMBlackBoxMatrixScriptElement

c_EPSText
Base object: "page item", 'pitm', kPageItemObjectScriptElement

Working with the INX file format 23


Working with the INX file format
ScriptID values used only in the INX file format

Parents:
z "spread", 'sprd', kSpreadObjectScriptElement
z "master spread", 'mspr', kMasterSpreadObjectScriptElement
z "page item", 'pitm', kPageItemObjectScriptElement
z "oval", 'covl', kOvalObjectScriptElement
z "rectangle", 'crec', kRectangleObjectScriptElement
z "polygon", 'cpgn', kPolygonObjectScriptElement
z "graphic line", 'glin', kGraphicLineObjectScriptElement
z "group", 'grop', kGroupObjectScriptElement
z "state", 'APrc', kAppearanceObjectScriptElement
z "document", 'docu', kDocumentObjectScriptElement
z "layer", 'layr', kLayerObjectScriptElement
z "page", 'page', kPageObjectScriptElement
z "button", 'Push', kPushButtonObjectScriptElement
z "text frame", 'txtf', kTextFrameObjectScriptElement
z "story", 'cflo' , kStoryObjectScriptElement
z "text", 'ctxt', kTextObjectScriptElement
z "character", 'cha ', CharacterObjectScriptElement
z "word", 'cwor', kWordObjectScriptElement
z "line", 'clin', kLineObjectScriptElement
z "text column", 'Ccol', kTextColumnObjectScriptElement
z "paragraph", 'cpar', kParagraphObjectScriptElement
z "text style range", 'txsr', kTextStyleRangeObjectScriptElement
z "cell", 'ccel', kCellObjectScriptElement
z "table", 'ctbl', kTableObjectScriptElement
z "insertion point", 'cins' , kInsertionPointObjectScriptElement
Properties:
z "item geometry", 'IGeo', kItemGeometryPropertyScriptElement
z "EPS text data", 'ETFC', kEPSTextDataPropertyScriptElement
z "EPS text attribute bounds", 'ETSC', kEPSTextAttrBoundPropertyScriptElement

c_XMLStory
Base object: "story", 'cflo', kStoryObjectScriptElement
Parents:
z "document", 'docu', kDocumentObjectScriptElement

24
Working with the INX file format
ScriptID values used only in the INX file format

Children:
z "text", 'ctxt', kTextObjectScriptElement
z "character", 'cha ', kCharacterObjectScriptElement
z "word", 'cwor', kWordObjectScriptElement
z "line", 'clin', kLineObjectScriptElement
z "text column", 'Ccol', kTextColumnObjectScriptElement
z "paragraph", 'cpar', kParagraphObjectScriptElement
z "insertion point", 'cins', kInsertionPointObjectScriptElement
z "text style range", 'txsr', kTextStyleRangeObjectScriptElement
z "table", 'ctbl', kTableObjectScriptElement
z "page item", 'pitm', kPageItemObjectScriptElement
z "story preference", 'SyPf', kStoryPrefsObjectScriptElement
z "grid data information", 'Jgda', kGridDataObjectScriptElement
z "metadata packet preference", 'cMep', kMetaDataPacketObjectScriptElement
Properties:
z "metadata packet", 'pMep', kMetaDataPacketPropertyScriptElement
z "lock state", 'lckS', kLockStatePropertyScriptElement
z "associated XML elements", 'Xans', kAssociatedXMLElementsPropertyScriptElement

c_MetaDataPacket
Base object: "preferences object", 'PObj', kPreferencesObjectScriptElement
Parents:
z "document", 'docu', kDocumentObjectScriptElement
z "graphic", 'Grfc', kGraphicObjectScriptElement
z "image", 'imag', kImageObjectScriptElement
z "EPS", 'EPS ', kEPSObjectScriptElement
z "WMF", 'WMF ', kWMFObjectScriptElement
z "PICT", 'PICT', kPICTObjectScriptElement
z "PDF", 'PDF ', kPDFObjectScriptElement
z "story", 'cflo', kStoryObjectScriptElement
z "xml story", 'cxst' kXMLStoryObjectScriptElement
Properties:
z "contents", 'pcnt', kAGMBlackBoxContentsScriptElement

Working with the INX file format 25


Working with the INX file format
Notes

Notes
Pay special attention to coordinates and their relationship to their parents.
The scripting model is always changing. Any time that a third-party plug-in is added, or an
existing plug-in is removed, the scripting DOM can change, which changes the INX file struc-
ture.
Some information is encoded and written as a block; accidentally overwriting it could change
the embedded images, sounds, video, and so on.
XML tags and enumerations in values are keywords to import INX; accidentally changing key-
words could cause the file to fail to import.
There is no definitive structure of INX files. There is no XML schema or anything like that that
describes the structure. However, if you have the debug version of InDesign, you may choose
Test > Diagnostics > INX DTD > Generate to generate a DTD of the current scripting DOM
tree. Just keep in mind that this is for information only, and you are not supposed to validate
INX against this DTD.

Appendix A: Attribute values


This section uses Extended Backus-Naur Form (EBNF) to represent the syntax of attribute val-
ues.

EBNF
() Group
{} Zero or more repetitions
[] Optional
| Choice

Non-terminals
Attribute_value ::= [ Read_only ] (Simple_value | Value_list)
Simple_value ::= Empty_value | Boolean_value | String_value |StringKey_value | Int16_value |
Int32_value| Readable_Double_value | Alt_Double_value | Object_value |
Readable_Date_value | Alt_Date_value | File_value |Enumeration_value |
Readable_Unit_value | Alt_Unit_value
Value_list ::= General_list | Object_list | Record_list
General_list ::= Type_list Separator List_count { Separator Simple_value }

26
Working with the INX file format
Appendix A: Attribute values

Record_list ::= Type_record Separator List_count { Separator Record_item_key Separator


Simple_value }
Object_list ::= Type_object_list Separator List_count { Separator Object_value }
Empty_value ::= Type_empty Separator
Boolean_value ::= Type_boolean Separator ( True | False )
String_value ::= Type_string Separator String
StringKey_value ::= Type_stringkey Separator String
Int16_value ::=Type_int16 Separator Hex_string
Int32_value ::= Type_int32 Separator Hex_string
Int64_value ::= Type_int64 Separator Bit64_string
Readable_Double_value ::= Type_readable_double Separator Double_string
Alt_Double_value ::= Type_alt_double Separator Bit64_string
Object_value ::= Type_object Separator String
Readable_Date_value ::= Type_readable_date Separator Date_string
Alt_Date_value ::= Type_alt_date Separator Bit64_string
File_value ::= Type_file Separator String
Enum_value ::= Type_enum Separator String (see Note 5)
Readable_Unit_value ::= Type_readable_unit Separator Double_string
Alt_Unit_value ::= Type_alt_unit Separator Bit64_string
List_count ::= Hex_string
Record_item_key ::= Hex_string
String ::= text with special processing for Separator (see Note 1)
Double_string ::= floating point decimal value (see Note 2)
Date_string ::= Decimal_string Decimal_string Decimal_string T Decimal_string :
Decimal_string : Decimal_string (see Note 3)
Bit64_string ::= Hex_string Bit_separator Hex_value (see Note 4)
Decimal_string ::= { Decimal_char }
Hex_string ::= { Hex_char }

Terminals
Read_only ::= r
Type_empty ::= 0
Type_boolean ::= b
Type_string ::= c

Working with the INX file format 27


Working with the INX file format
Appendix A: Attribute values

Type_stringkey ::= k
Type_int16 ::= s
Type_int32 ::= l
Type_int64 ::= L
Type_readable_double ::= D
Type_alt_double ::= d
Type_object ::= o
Type_readable_date ::= T
Type_alt_date ::= t
Type_file ::= f
Type_enum ::= e
Type_readable_unit ::= U
Type_alt_unit ::= u
Type_list ::= x
Type_object_list ::= y
Type_record ::= z
Separator ::= _
True ::= t
False ::= f
Decimal_char ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Hex_char ::= Decimal_char | a | b | c | d | e | f
Bit_separator ::= ~

Notes
1. A string can contain anything (including white space) except a separator (_). If a separa-
tor occurs in the string, it is replaced by a separator sequence (~sep~). You should check
for this sequence and replace it with a separator prior to using the string value.
2. Informally: 3 or -2.98 or 5.002.
3. An XML-standard date/time string. Informally: yyyy - mm - dd T hh : mm : ss
4. 64-bit values are stored as two 32-bit components, the high-order 32-bits, a ~, followed by
the low-order 32-bits. This separator prevents having to write a fixed number of hex digits
for each component.
5. The "String" in enum value is a four-character ScriptID representing the enumeration value.

28
Working with the INX file format
Appendix B: Objects with ordered children

Appendix B: Objects with ordered children

Document
The document children appear in the following order:
XML items (c_XMLItem, 'cxit');
XML export maps(c_XMLStyleToTagMap, 'stmX');
XML import maps(c_XMLTagToStyleMap, 'tsmX');
Colors (c_Color, 'colr');
Mixed ink groups(c_MixedInkGroup, MxSg');
Mixed inks(c_MixedInk, 'MxSw');
Pasted smooth shades(c_AGMBlackBox, 'ctbb');
Tints(c_Tint, 'tint');
Swatchs(c_Swatch, 'swch');
Gradients(c_Gradient, 'grad');
Fonts(c_Font, 'FonT');
Character styles(c_CharStyle,'csty');
Paragraph styles(c_ParaStyle,'psty');
Named grids(c_NamedGrid, 'Jngd');
Kinsoku tables(c_KinsokuTable, 'Jkst');
Mojikumi tables(c_MojikumiTable, Jmjt');
Languages(c_Language, 'lang');
Preferences(all kind of preference objects);
Stroke styles(c_StrokeStyle, 'StSt');
XML tags (c_XMLTag, 'tagX');
Layers(c_Layer, 'layr');
Master spreads(c_MasterSpread, 'mspr');
Spreads(c_Spread, 'sprd');
Sections(c_Section, 'sctn');
PageItems(c_PageItem, 'pitm', all types of page items document directly own);
Stories(all stories);
Hyperlink text destinations(c_HyperlinkTextDestination, 'HLTd');
Hyperlink page destinations(c_HyperlinkPageDestination, 'HLPD');
Hyperlink URL destinations(c_HyperlinkURLDestination, 'HLUD');
Hyperlink external destinations(c_HyperlinkExternalPageDestination, 'HLEP');
hyperlink text sources(c_HyperlinkTextSource, 'HLTS');
hyperlink page item sources(c_HyperlinkPageItemSource, 'HLPs');
Hyperlinks(c_Hyperlink, 'HLOB');
Bookmarks(c_Bookmark, 'Bkmk');
All other remaining children of document;

Spread
The spread children appear in the following order:
First write non-page items;
Then write page items in reverse z-order (to make importing more efficient)

Working with the INX file format 29


Working with the INX file format
Appendix B: Objects with ordered children

Table
The table children appear in the following order:
Table rows (c_TableRow, 'crow');
Table columns(c_TableColumn, 'ccol');
All other remaining children;

Story
The story children appear in the following order:
Put all story preferences first.
Text style ranges(c_TextStyleRange, 'txsr');
Tables(c_Table, ctbl');
Page items(c_PageItem, 'pitm', all types of page items story own);
Notes (c_Note, 'Note');
Changes (c_Change, 'Chng');
All other remaining children;

30

Das könnte Ihnen auch gefallen