12.07.2015 Views

Working with INX file format - Adobe Partners

Working with INX file format - Adobe Partners

Working with INX file format - Adobe Partners

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Working</strong> <strong>with</strong> <strong>INX</strong> <strong>file</strong> <strong>format</strong>Solutions Document #10091Version InDesign CS2 / InCopy CS208 Nov 2005ADOBE SYSTEMS INCORPORATEDCorporate Headquarters345 Park AvenueSan Jose, CA 95110-2704


<strong>Working</strong> <strong>with</strong> <strong>INX</strong> <strong>file</strong> <strong>format</strong>Copyright 2005 <strong>Adobe</strong> Systems Incorporated. All rights reserved.The in<strong>format</strong>ion in this document is furnished for in<strong>format</strong>ional use only, is subject to change <strong>with</strong>out notice, and should not be construed as acommitment by <strong>Adobe</strong> Systems Incorporated. <strong>Adobe</strong> Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies thatmay appear in this document. The software described in this document is furnished under license and may only be used or copied in accordance<strong>with</strong> the terms of such license.<strong>Adobe</strong>, <strong>Adobe</strong> logo, <strong>Adobe</strong> Acrobat, <strong>Adobe</strong> InCopy, <strong>Adobe</strong> InDesign, <strong>Adobe</strong> Type Manager, and PostScript are either registered trademarks ortrademarks of <strong>Adobe</strong> Systems Incorporated in the United States and/or other countries. Macintosh and Mac OS are either registered trademarks ortrademarks of Apple Computer, Inc. in the United States and/or other countries. Microsoft, Windows, and Windows XP are either registeredtrademarks or trademarks of Microsoft Corporation in the United States and/or other countries. All other products or name brands are trademarksof their respective owners.Revision Date Author Comments1.0 6/03/04 Shengliu Dai initial documentation1.1 3/15/05 Rodney Cook CS2 revisions1.2 11/8/05 Todd Kopriva Editing


ContentsStory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30iv 08 Nov 2005 <strong>Working</strong> <strong>with</strong> <strong>INX</strong> <strong>file</strong> <strong>format</strong>


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong><strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Getting started <strong>with</strong> <strong>INX</strong> <strong>file</strong> <strong>format</strong>Getting started <strong>with</strong> <strong>INX</strong> <strong>file</strong> <strong>format</strong>This document provides in<strong>format</strong>ion about the InDesign Interchange (<strong>INX</strong>) <strong>file</strong> <strong>format</strong> andhow to read and understand <strong>INX</strong> <strong>file</strong>s. This document covers the structure of the <strong>INX</strong> <strong>file</strong>, thealgorithm to decode any object <strong>with</strong>in the <strong>file</strong>, and processing instructions for some specialcontent of the <strong>file</strong>. The appendixes provide a list of scripting IDs that are used in Save Backwardsbut are not documented in the Scripting Reference, the formal semantics of attribute values,and a list of objects that require special ordering of their children.Before you begin, you must have the following:• A basic understanding of XML• A basic understanding of <strong>Adobe</strong> InDesign, InDesign scripting, and the InDesign scriptingdocument object model (DOM)• Access to the <strong>Adobe</strong> InDesign Scripting Reference• A copy of the ScriptID value-name lookup table (At least, you should have a copy of ScriptingDefs.h.)Introduction to the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Overview of the <strong>INX</strong> <strong>file</strong> <strong>format</strong><strong>INX</strong> is an XML-based <strong>format</strong> used to serialize and deserialize the InDesign scripting DOM.This <strong>format</strong> is most useful <strong>with</strong> the Save Backwards feature of InDesign, which allows you touse an earlier version of InDesign to open a document that was created in a later version ofInDesign. InCopy and GoLive also use the <strong>INX</strong> <strong>format</strong>. Each of these usages has a different setof valid elements and attributes; this document addresses only the elements used in the SaveBackwards feature. However, concepts introduced here also apply to other situations.In the InDesign scripting DOM, every InDesign document is described by a tree structure ofscripting objects, rooted at a Document object. For example, a document has several childrenthat are Color objects, several children that are Spread objects, and so on. Besides having children,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 <strong>INX</strong> <strong>file</strong>, every object, its properties, and theirvalues are translated into XML. When an <strong>INX</strong> <strong>file</strong> is imported, this in<strong>format</strong>ion is used to createa new InDesign document.<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 5


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Introduction to the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Exporting an InDesign CS2 document as <strong>INX</strong> data and then importing the <strong>INX</strong> data into thesame version of InDesign CS2 exactly recreates the original document. Importing the <strong>INX</strong> datainto an earlier version (e.g., InDesign CS) requires the Save Backwards feature. Exporting andimporting fragments of documents enables the asset libraries, actions, and InCopy stories features,and possibly other features.When a document is saved in <strong>INX</strong> <strong>format</strong> as part of a Save Backwards operation, an entirelynew InDesign document is created from the <strong>INX</strong> data. Because of differences between versionsof InDesign, the resulting document may not look exactly like the original. For example, differencesin the composition algorithm may cause slight differences. The new <strong>INX</strong> <strong>file</strong> may containobjects or object properties that did not exist in the earlier version of InDesign; these objectsand properties are ignored during import into the earlier version of InDesign.Understanding the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Because an <strong>INX</strong> <strong>file</strong> is the serialized state of a DOM tree and a <strong>file</strong>’s content depends on what isin the tree, there is no formal definition or static description for <strong>INX</strong> <strong>file</strong>s. This is a necessaryfeature of the <strong>INX</strong> technology; because <strong>INX</strong> is based on the scripting DOM, and the DOM isextensible by third-party plug-in developers, it follows that any plug-in developers can havetheir data represented in <strong>INX</strong> simply by including appropriate scripting support for their features.Of course, this does make creating and parsing <strong>INX</strong> <strong>file</strong>s more difficult.Each <strong>INX</strong> <strong>file</strong> begins <strong>with</strong> a standard XML declaration. The next line is an <strong>INX</strong>-specific processinginstruction (PI), which might be followed by additional processing instructions. Nextcomes the outermost (root) XML element document (docu), which represents the Documentobject in the scripting DOM. (For uses other than Save Backwards, such as assignment, theoutermost element may be something other than Document.) Everything else is either a childof the root element, or a child of a child.Each scripting DOM object is represented by an XML element. Each object property becomesan 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 attributevalue string. Moreover, property values can be complex types, including heterogeneous listsand lists of lists. See “Appendix A: Attribute values” on page 26.Hierarchy of objectsAn <strong>INX</strong> <strong>file</strong> is usually large and consists of obscure-looking codes, so it appears to be complicated.However, the <strong>INX</strong> <strong>file</strong> structure is simple. To get an impression of what an <strong>INX</strong> <strong>file</strong> lookslike do the following:1. In InDesign, open a very simple InDesign document. (An empty document will suffice forthis exercise.)2. Export the document to <strong>INX</strong> <strong>format</strong> by choosing File > Export and selecting InDesignInterchange.6


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Introduction to the <strong>INX</strong> <strong>file</strong> <strong>format</strong>3. Open the <strong>file</strong> in a text editor, such as Notepad, Visual Studio, or an XML editor such asXMLSpy.The hierarchical scripting document object model is exactly the same as the InDesign scriptingDOM. Compared to the legacy scripting view, there are only a few differences:• A few new objects store in<strong>format</strong>ion for facilitating the processing of <strong>INX</strong> (such as theInsertionPoint object).• A few attributes are added and a few are removed to improve the performance of <strong>INX</strong> <strong>file</strong>export and import.• Scripting events are not relevant to <strong>INX</strong>.Order of objectsInside the document object, its first-level (direct) child objects are listed one by one, indentedby one tab character. The document’s preference objects are listed first; followed by more visiblecontent, such as layers, master spreads, spreads, sections, XMLStory, stories, and so on; thefinal part contains other objects.In general, children appear in the same order as in the scripting DOM. You can regard this asrandom 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 thecase of the document object itself, its children are sorted. For a list of objects whose childrenare placed in a certain order and their respective algorithms, refer to “Appendix B: Objects <strong>with</strong>ordered children” on page 29.NOTE:The order of the children might change at any time. Do not reorder the objects; doingso could cause problems because certain objects require that others be created first.Custom export and import of <strong>INX</strong> <strong>file</strong>sUsually, third-party plug-in developers don’t need to implement custom export and import of<strong>INX</strong> <strong>file</strong>s. Even if you have custom persistent data in your plug-in, as long as you providescripting support for your data, the InDesign or InCopy application will export or import thesedata for you. But if you do have to write custom code to export or import these <strong>file</strong>s, be awarethat for InDesign CS2 and InCopy CS2 you need to send NewDocResponder signals andOpenDocResponder signals; this may change in a future version of InDesign and InCopy. Theresponses to NewDocRepsonder and OpenDocResponder signals sometimes share similarcode (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 correspondingNewDocResponder has already been executed.<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 7


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Interpreting <strong>INX</strong> <strong>file</strong> contentInterpreting <strong>INX</strong> <strong>file</strong> content<strong>INX</strong> <strong>file</strong> headerThe first line of an <strong>INX</strong> <strong>file</strong> is a standard XML declaration that looks like this:The next line is an <strong>INX</strong>-specific processing instruction. It contains in<strong>format</strong>ion required byInDesign to properly configure the import process. Here is an example:TABLE 1 <strong>INX</strong> head settingsElementaidstyletypeDOMVersionfeatureSetDescriptionReserved token that InDesign uses for its <strong>INX</strong>-processing instructions.Identifies style, which is set forth for various <strong>INX</strong>Options, 33 = 0x21, whichrepresents InDesign CS2, use Readable numbers.Identifies the intended use of this <strong>INX</strong> <strong>file</strong>. <strong>INX</strong> <strong>file</strong>s that serialize the state of anInDesign document are of type document.Identifies the version of the scripting DOM that was used to export the <strong>file</strong>.Currently, there are two possible values: 1 for InDesign CS and 4.0 for InDesignCS2.Identifies the scripting DOM feature set that was used during export. This value iseither 256 for the Roman feature set or 257 for Japanese.Element and attribute namesInDesign writes four-character ScriptID values to <strong>INX</strong> <strong>file</strong>s. The following table shows examplesof the ScriptID names and ScriptID values for a few common elements.TABLE 2 ScriptID names and ScriptID valuesScriptID namesDocumentColorSpreadStoryTextStyleRangeItem GeometryScriptID valuesdocucolrsprdcflotxsrIGeo8


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Interpreting <strong>INX</strong> <strong>file</strong> contentBecause the names are derived directly from the scripting DOM, you can refer to the InDesignScripting 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 <strong>INX</strong> andare not documented in the Scripting Reference. See “ScriptID values used only in the<strong>INX</strong> <strong>file</strong> <strong>format</strong>” on page 14 for details.Processing object referencesIn the scripting DOM, some objects are children of other objects, and some objects point toother objects. For example, a paragraph style contains a property that points to its parent style.<strong>INX</strong> represents these pointers by assigning a unique Self attribute to each element. The specificvalue is not important. What is important is that each value is a string that is unique <strong>with</strong>in the<strong>INX</strong> <strong>file</strong>.A property that points to another object (an object reference) has a value of type Object. Theremay, of course, be many references to the same object.NOTE: <strong>INX</strong> <strong>file</strong>s can contain forward references.Pointers from one <strong>file</strong> to another are not possible. In this sense, <strong>INX</strong> behaves like href/id ratherthan like xpointer.Here is a simplified example of a Tint that is based on a Color. In this example, the color’s Selfvalue is the string “ue”. It is referenced by the tint’s clbs (Base Color) attribute:Some facts about object references:• The value of the object’s Self attribute and the reference value in other objects’ properties areguaranteed by using the same routine when exporting to an <strong>INX</strong> <strong>file</strong>.• There can be zero or more references that point to the same object.• 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 elementAn element is represented as its attributes and children. Here is an example of a gradient element<strong>with</strong> two child elements:<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 9


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Interpreting <strong>INX</strong> <strong>file</strong> contentEach element, whether parent or child, expresses the following:• The object’s name, represented by its ScriptID value, which is the four-character XML tag(for example, ). To find the full ScriptID name and description of the object, lookit up in the value-name lookup table. For example, grad represents gradient.• A list of attributes of the form scriptIdValue=“type_value”; for example, grdt=“e_axlg” orloca=“D_0”. See Table 3.TABLE 3 Interpreting an ID value pairscriptIdValuetypevalueRepresents the property name of the attribute. Look it up in the value-name lookuptable. For example, grdt is the gradient 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.The value of the attribute. The value is represented by the characters after theunderscore (_) character. For example, “D_100” represents a Double valued 100.00; b_trepresents a Boolean <strong>with</strong> the value of true; o_u7c represents an object reference <strong>with</strong>identifier u7c. If the type is Type_enum, then look up its ScriptID value in the valuenamelookup table; for example, e_axlg represents an enumeration of type Linear.Attributes values can contain subvalues; for example, a list containing items. For this, recursivelyanalyze each item as shown in Table 3. For each child element, recursively interpret theelement and its attributes. By such recursive analysis, you can translate each plain, static XMLelement and attribute to dynamic, structured scripting DOM objects and properties.Simple text contentText is contained in a Contents element (ScriptID value pcnt) that is a child of a Text StyleRange 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 StyleRange defines the attributes to apply to the text. So, a simple range of text might look like this:c_Hello world.The contents of the Contents element is in serialized form. The leading c_ indicates that thecontents are expressed as a string.Special characters in textText may contain any characters, including special characters that InDesign and InCopy support.However, some characters are not allowed in a well-formed XML document. These charactersare encoded in an ACE processing instruction so that the data can correctly make theround trip from an InDesign native document to <strong>INX</strong> <strong>format</strong> and back again. In the examplebelow, represents the Auto Page Number special character.c_Hello world.10


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Interpreting <strong>INX</strong> <strong>file</strong> contentThe characters disallowed from a well-formed XML document are as follows (values in hexadecimal):• 0x0000-0x0008• 0x000B• 0x000C• 0x000E-0x001F• 0xD800-0xDFFFYou can compare ACE values to those found in TextChar.h. For example, representsFootnote Marker; represents Section Marker.NOTE:This special treatment is common for <strong>INX</strong> and XML.Text attributes in stories and table cellsOne or more Text Style Range elements make up the textual contents of a Story (cflo) or a TableCell (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, youwill see a reference to Paragraph Style (psty) and Character Style (csty) elements. The Text StyleRange object inherits its attribute values from its styles. If an attribute value is overridden, itappears as an attribute of the Text Style Range. Attributes not explicitly defined for the TextStyle Range are assumed to come from the underlying styles.Character and paragraph styles are hierarchical. Each style is based on another style anddefines only the attributes that differ from its parent style. At the bottom of the hierarchy arethe 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 attributesand their values.Marker processing instructionSometimes you need to be able to refer to a location between two characters in a story. Considerthis example:c_Text <strong>with</strong> inline graphic.The processing instruction (?aid) in the middle of the text is an insertion point marker.<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 11


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Interpreting <strong>INX</strong> <strong>file</strong> contentTable attributesRecall from the discussion of object references that a Self property serves as the target forobject-to-object references. Recall also that the value of the property is unimportant; it is simplya string that is guaranteed to be unique <strong>with</strong>in the <strong>INX</strong> <strong>file</strong>.In the preceding example, the text implies that the marker is used to indicate where an inlinegraphic should be placed. Elsewhere in the <strong>INX</strong> <strong>file</strong> is an element <strong>with</strong> an attribute that referencesthe 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 forsimplicity:…The rectangle’s 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 oftext, such as a range of tagged text.Table cells also have attributes. Do not confuse these <strong>with</strong> the attributes of the text that the cellscontain. An example of a cell attribute is its stroke style.Processing cell attributes is similar to processing text attributes. Things are slightly easierbecause, as of now, there is only a single base table style. Every table is deemed to have the set ofattributes 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 andCell 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<strong>with</strong> the attributes defined in the base table style.Alternative double and unit representationsReal numbers are represented in one of two ways—readable or binary—depending on anoption set using <strong>INX</strong>Options during export. Because readable and binary numbers have differenttype codes (D versus d and U versus u), it is theoretically possible to find both in a single<strong>INX</strong> <strong>file</strong>. In practice, however, this does not occur.To process the readable <strong>format</strong>, use a good text-to-real conversion algorithm, otherwise, loss ofprecision is possible.The binary <strong>format</strong> is a direct representation of the bits in an IEEE-754 floating-point value.12


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Interpreting <strong>INX</strong> <strong>file</strong> contentAlternative date and time representationList typeLike real numbers, time stamps can have two different representations, binary and readable:• 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 FILETIMEon Windows. This value can be processed using the Deserialize64() function.• The readable representation is as an XML-standard date and time string. It looks like this:yyyy-mm-ddThh:mm:ssNote that the dash (-), the character T, and the semicolon (:) are separator characters.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 <strong>with</strong> four items. Theitems are of type Type_readable_double, and all have the value 0. That is, the C, M, Y, and Kcomponents are all 0.Special attention is required for lists, because they are generated dynamically; before a list isexported to an <strong>INX</strong> <strong>file</strong>, 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 enumeration,the fourth an object, and so on. The following example describes a page item (rectangle):<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 13


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>IGeo (Item Geometry) of crec (rectangle) is a general list <strong>with</strong> 25 items (the length is stored inhexadecimal form after the type terminator, where 0x19 equals 25). It may be difficult tounderstand this list until you know the proper structure of the property. Fortunately, theScripting Guide describes each property and its possible values. Those few special propertiesthat are used only when exporting and importing <strong>INX</strong>—such as IGeo—are documented in“ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>” 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, itshould be resolved on a case-by-case basis.Encoded blockThe <strong>INX</strong> <strong>file</strong> contains several blocks of ASCII encoding data. Data is encoded because it isbinary and must be encoded to put it into an XML <strong>file</strong>. There are some exceptions, such as EPSText Data.NOTE:Do not alter the content of any encoded block.ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>EnumerationsThe following enumerations are special to the <strong>INX</strong> <strong>file</strong> <strong>format</strong>. The rightmost two column inthe table describe the possible enumerators.14


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>FIGURE 1Table of enumerationsEnum typeen_EncodingTypeEnumtypenameencodingtypeEnumtypeIDetenDescriptionHow contents’ value isencoded. Value type ofp_BinaryBlobEncodingpropertyEnumIDethxeta8eta6Enum namehex encodingascii85 encodingascii64 encodingen_AGMBlackBoxTypecontentstypesettingsbbteTypes of smooth shades bbta axial shadepersisted. Value type of bbtr radial shadep_AGMBlackBoxType bbtm mesh shadeproperty bbtc constant shadeen_GridStartingPointTypeen_OverridegridstartingpointoptionscoloroverrideGstpeOvrOptions for the gridstarting point. Value typeof p_GridStartingPointpropertyThe override type. Valuetype of p_OverridepropertygstogstigsbogsbigscvgschgsccnormeOvPeOvBeOvReOvHeOvMtop outsidetop insidebottom outsidebottom insidecenter verticalcenter horizontalcenter completelynormalspecialpaperspecialblackspecialregistratio nhiddenreservedmixedinkparentPropertiesThe following table lists the properties that are special to <strong>INX</strong>. For the purpose of understanding<strong>INX</strong>, if the storage type is simple, you can assume that the value string in the <strong>INX</strong> is quitesimple, too (for example, because storage type Long means that the value is a long int, you canexpect the value string to be something like “l_12345” and just interpret the result as integer12345). However, if the storage type is complex (such as an array of arrays of mixed types),decoding is also more complex. In<strong>format</strong>ion on how to decode the specific value strings aregiven in Table 4.NOTE: Some Property IDs represent different Scripting Elements, so their meaning could bedifferent. Also, to facilitate fast lookup, the table is sorted according to the ScriptIDvalue.TABLE 4 Property tableProperty IDScriptIDnameScriptIDvalueScripting element ID Storage type Commentsp_AllRunInStylesAll nestedstylesalrskAllRunInStylesPropertyScriptElementArray of arraysof ID/value pairsSee “p_AllRunInStyles”on page 19.<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 15


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Property IDScriptIDnameScriptIDvalueScripting element ID Storage type Commentsp_AppliedTOCStyleAppliedTOC StyleATOCkAppliedTOCStylePropertyScriptElementTOCStyleReference to TOCStyleobjectp_BinaryBlobEncodingcontentsencodingbbenkAGMBlackBoxEncodingScriptElementEncodingTypeenumeratorSee enum explanation in“Enumerations” onpage 14.p_AGMBlackBoxMatrixcontentsmatrixbbmxkAGMBlackBoxMatrixScriptElementArray of six RealvaluesMatrixp_AGMBlackBoxTypecontentstypebbtpkAGMBlackBoxTypeScriptElementContentsTypeSettingsenumeratorSee enum explanation in“Enumerations” onpage 14.p_BNBulletCharbullet char bnbc kBNBulletCharacterPropertyScriptElementArray ofBulletcharactertype enumeratorsor LongsSee “p_BNBulletChar” onpage 20.p_BindingLocationbindinglocationBnLckBindingLocationPropertyScriptElementLongp_BaseColor base color clbs kBaseColorPropertyScriptElementColorObject reference to colortypep_DMDataSourceFiledata source<strong>file</strong>dsflkDataMergeDataSourceFileScriptElementFileA value for the formf_xxx, where xxx is <strong>file</strong>namestring of SysFilep_DMDataSourceFileTypedata source<strong>file</strong> typedsftkDataMergeDataSourceFileTypeScriptElementDataSourceTypeenumeratorEnumerators:en_DataMergeCommaSeperated, commaseparated,dmCs;en_DataMergeTabDelimited, tab-delimited, 'dmTd'p_EditablecoloreditableedblkColorEditablePropertyScriptElementBooleanp_EPSTextDataEPS textdataETFCkEPSTextDataPropertyScriptElementStringSimilar to image, storesencoded EPS text datarecord16


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Property IDScriptIDnameScriptIDvalueScripting element ID Storage type Commentsp_HyperlinkDestinationdestination hlds kDestinationPropertyScriptElementArray of String,Long, orBoolean values,HyperlinkTextDestination,HyperlinkPageDestination,HyperlinkExternalPageDestination, orHyperlinkURLDestinationSee“p_HyperlinkDestination”on page 20.p_ItemGeometryitemgeometryIGeokItemGeometryPropertyScriptElementArray of Long,Boolean, or RealvaluesSee “p_ItemGeometry” onpage 20.p_InstanceListinstancelistInLikIndexInstanceListPropertyScriptElementArray of stringsor storyreferencesSee “p_InstanceList” onpage 21.p_GridStartingPointgridstartingpointJgspkGridStartingPointPropertyScriptElementGridStartingPointOptionsenumeratorSee enum explanation in“Enumerations” onpage 14.p_MojikumiUISettingsmojikumiUI settingsjmuskMojikumiUISettingsPropertyScriptElementShortThis is a private, Japaneseonlypreference setting.p_RubyFlag ruby flag jrfg kRubyFlagPropertyScriptElementLongThis is a private, Japaneseonlypreference setting.p_UseMasterGriduse mastergridJumgkUseMasterGridPropertyScriptElementBooleanp_ColumnWidthcolumnwidthklwdkColumnWidthPropertyScriptElementUnitProperty of table and tablestyle objectsp_LinkInfolinked <strong>file</strong>infoLnkIkLinkInfoPropertyScriptElementArray of Strings,Longs, Dates orBooleansSee “p_LinkInfo” onpage 21.p_CanChoosePosterscan choosepostersMccpkCanChoosePostersPropertyScriptElementBooleanp_CustomPostercustomposterMcspkCustomPosterPropertyScriptElementBooleanp_FixedHeightfixedheightMFHokFixedHeightPropertyScriptElementUnitProperty of table and tablestyle objects<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 17


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Property IDScriptIDnameScriptIDvalueScripting element ID Storage type Commentsp_IntrinsicBoundsintrinsicboundsMibdkIntrinsicMovieBoundsPropertyScriptElementArray of twoLong valuesStore width and height ofintrinsic bounds (of moviepage item).p_PosterIsAvailableposteravailableMpiakPosterIsAvailablePropertyScriptElementBooleanp_MixedInkInkNamesink namelistmxnmkInkNameArrayPropertyScriptElementArray of StringvaluesInk namesp_OverridenPageItemPropsoverriddenpage itempropsovppkOverridenPIPropsPropertyScriptElementArray of LongvaluesStores a list of InterfaceIDs that are locallychanged; that is, used indescribing locallyoverridden page items.p_OverridecoloroverrideovrdkColorOverridePropertyScriptElementColorOverrideenumeratorSee enum explanation in“Enumerations” onpage 14.p_OverrideListoverridelistovrlkOverrideListPropertyScriptElementArray ofPageItem valuesSee “p_OverrideList” onpage 22.p_PageCount page count PagC kPageCountPropertyScriptElementLongp_AllCellGradientAttrListall cellgradientattr listpcglkAllCellGradientAttrListPropertyScriptElementArray of Realvalues, arrays oftwo Unit valuesGeneral list type. First twoitems are length and angleof cell gradient, third is alist <strong>with</strong> two items, whichare (x, y) coordinates ofgradient center.p_Contents contents pcnt kContentPropertyScriptElementp_Contents contents pcnt kImageContentsScriptElementp_Contents contents pcnt kAGMBlackBoxContentsScriptElementStringStringStringSee “p_Content” onpage 22.See “p_Content” onpage 22.See “p_Content” onpage 22.p_MetaDataPacketmetadatapacketpMepkMetaDataPacketPropertyScriptElementMetadataPacketPreferenceStores object reference ofkMetaDataPacketObjectScriptElement object,which has property ofkContentPropertyScriptElement property.p_Visible visible pvis kColorVisiblePropertyScriptElementBoolean18


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Property IDScriptIDnameScriptIDvalueScripting element ID Storage type Commentsp_AGMBlackBoxVersioncontentsversionpvrskAGMBlackBoxVersionScriptElementLongp_RemovablecolorremovablermblkColorRemovablePropertyScriptElementBooleanp_SpotColorListspot colorlistspclkSpotListPropertyScriptElementArray ofSwatchesProperty onkAGMBlackBoxObjectScriptElement(c_AGMBlackBox, "pasted smoothshade"). Its value is objectlist of Swatch.p_SpecialGlyphcustomglyphSpGlkSpecialGlyphPropertyScriptElementLongNop_StoryOffset story offset STof kPIStoryOffsetPropertyScriptElementp_StoryOffset story offset STof kChangeStoryOffsetPropertyScriptElementp_StoryOffset story offset STof kStoryOffsetPropertyScriptElementp_StoryOffset story offset STof kNoteStoryOffsetPropertyScriptElementInsertionPointInsertionPointInsertionPointInsertionPointSee “p_StoryOffset” onpage 23.See “p_StoryOffset” onpage 23.See “p_StoryOffset” onpage 23.See “p_StoryOffset” onpage 23.p_XMLContentXMLcontentXcntkXMLContentPropertyScriptElementText, Story,PageItem,Movie, Sound,Image, EPS orPDFStores object reference toactual page itemp_AllRunInStylesStorage type: Array of arrays of ID/value pairsThis 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/valuepairs for the first example record shown above, you can see the following:• x_4 indicates a general list type of four items.<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 19


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>• z_4 indicates a Record list <strong>with</strong> four items that represents all properties of a kAllRunInStyle-ObjectScriptElement.• 63727374_o_u58 indicates a property of crst/p_AppliedCharStyle on kCharacterStylePropertyScriptElement,whose value is an object.• 72697465_e_RIdc indicates a property of rite/p_RunInTriggerExp ("delimiter") onkTriggerExpressionPropertyScriptElement, whose value is an enum.• 72696374_l_1_ indicates a property of rict/p_RunInCount ("repetition") on kRunInCount-PropertyScriptElement, whose value is a long int.• 72696963_b_t_ indicates a property of riic/p_RunInInclusive on kRunInInclusiveScriptElement,whose value is a Boolean.NOTE:This decodes one Record list; you could apply the same method to the other threerecords, thereby decoding the whole value string.p_BNBulletCharStorage type: Array of Bulletcharactertype enumerators or Long values<strong>INX</strong> uses the kBNBulletCharacterPropertyScriptElement to access the kBNBulletCharacter-ObjectScriptElement object’s 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"• x_2 indicates a general list type of two items.• e_BCuf indicates an enum whose value is BCuf/en_BCUnicodeWithFont. Other possiblevalues are BCuo/en_BCUnicodeOnly and BCgf/en_BCGlyphWithFont.• l_2022 indicates a long whose value is 2022.p_HyperlinkDestinationStorage type: Array of String, Long or Boolean values, HyperlinkTextDestination, HyperlinkPageDestination,HyperlinkExternalPageDestination, or HyperlinkURLDestinationThe storage type looks complicated, but it actually has only the following three cases:• If there is no destination indicated, the value is a nil object reference.• If it is an external destination, then the value is a list of external datalink in<strong>format</strong>ion, whichstores <strong>file</strong> name, volume name, DirID, ClassID, and hyperlink destination UID. Except forthe last item, they are the same as “p_LinkInfo” on page 21.• If it is a valid internal destination, it stores the object reference to the destination (that is, thexxxDestination objects).p_ItemGeometryStorage type: Array of Long, Boolean, or Real valuesp_ItemGeometry is a complex property. It stores geometry in<strong>format</strong>ion about a page item. Itsvalue is a list that has mixed value items.20


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>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:• x_19 indicates a general list type of 25 (0x19) items.• l_1 indicates that there is a single path. If there were more than one path, the other pathswould be inserted after b_f, which marks the end of a path.• l_4 indicates the start of a path containing four points.• 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'sX(), 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 therewould be another four numbers. The same rules apply to the second, third, and fourthpoints.• b_f indicates the end of the single path containing four points, whose Boolean value specifieswhether the path is open.• D_36_D_360_D_309.8181818181818_D_-175.2 indicates the geometric bounds, four doublevalues that represent the left, top, right, and bottom of the bounding box.• D_1_D_0_D_0_D_1_D_0_D_0 indicates the transform matrix, whose six double valuesrepresent the matrix.• If the item has graphic bounds, an additional four double values represent the left, top,right, and bottom of the graphic bounding box.p_InstanceListStorage Type: Array of strings or story references• This is a general list that stores names (string) and stories (object reference) of indexinstances alternatively (odd-numbered items are names, even-numbered items are stories).• This is a property of the document object.p_LinkInfoStorage type: Array of String, Long, Date, or Boolean valuesStores link in<strong>format</strong>ion.An example:LnkI="x_c_c_C:\shuksan\build\qa\test<strong>file</strong>\BOTTLE.TIF_c__l_0_l_8c01_c_TIFF_l_0_c__t_0~21fd4_t_1c4137a~defef92a_l_0_b_t_b_f"• x_c indicates a general list type of 12 (0x0c) items.• c_C:\shuksan\build\qa\test<strong>file</strong>\BOTTLE.TIF indicates a string representing the link pathand <strong>file</strong> name.<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 21


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>• c__ indicates a string representing the link Volume, whose value (on Windows) is an emptystring.• l_0 indicates a long representing the the DirID, whose value (on Windows) is 0.• l_8c01 indicates a long representing the ClassID, whose value is kDataLinkBoss.• c_TIFF indicates a string representing the <strong>format</strong> name.• l_0 indicates a long representing <strong>file</strong> type.• c__ indicates a string representing the datalink full name for Mac OS, whose value (on Windows)is an empty string.• t_0~21fd4 indicates a 64-bit Type_alt_date representing the <strong>file</strong> size. The 64-bit value is separatedinto two 32-bit values by a tilde (~).• t_1c4137a~defef92a indicates a 64-bit Type_alt_date representing the <strong>file</strong> time stamp. The64-bit value is separated into two 32-bit values by a tilde (~).• l_0 indicates a long representing the link state, which is (IDataLink::kLinkNormal). Forother possible values, refer to IDataLink.h.• b_t indicates a Boolean representing the return value of IsLinkNeeded().• b_f indicates a Boolean representing the return value of HasInternalDataChanged().p_OverrideListStorage type: Array of PageItem valuesStores a list of (master page item, layout page item) pairs <strong>with</strong>in the page (because the pageobject has this property).For example:ovrl="x_6_o_ucc_o_ud6_o_uf6_o_uf9_o_uf4_o_ufb"• x_6 indicates a general list type of six items.• o_ucc_o_ud6 indicates a (master page item, layout page item) pair.• o_uf6_o_uf9 indicates a (master page item, layout page item) pair.• o_uf4_o_ufb indicates a (master page item, layout page item) pair.p_ContentStorage type: Stringp_Content is also used in other objects where content has a meaningful string, such as the textcontent of a story; but for these property elements that are available only in <strong>INX</strong>, p_Content isused differently.• For kImageContentsScriptElement and kAGMBlackBoxContentsScriptElement, p_Contentrepresents IAsciiEncodingUtils::kAscii64Encoding (or some other encoding type), anencoded string of image content. Do not modify it directly.• For kContentPropertyScriptElement, p_Content represents the XML packet representingthe metadata. It’s a property of kMetaDataPacketObjectScriptElement (metadata packetpreference). The stored strings are also not encoded.22


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>p_StoryOffsetStorage Type: InsertionPoint.p_StoryOffset represents kPIStoryOffsetPropertyScriptElement, kChangeStoryOffsetProperty-ScriptElement, kStoryOffsetPropertyScriptElement, and kNoteStoryOffsetPropertyScriptElement.The value is an object reference to InsertionPoint. InsertionPoint is a special object that marksa position inside text. See “Marker processing instruction” on page 11.ObjectsTable 5 summarizes objects that are available only in <strong>INX</strong>. Details about their base objects, parentobjects, children, and special properties are listed in the following detail sections.TABLE 5 Objects tableObject ID Name 4-charvalueScripting element IDc_AGMBlackBoxpasted smoothshadectbbkAGMBlackBoxObjectScriptElementc_EPSText EPSText EPST kEPSTextObjectScriptElementc_XMLStory xml story bnbc kXMLStoryObjectScriptElementc_MetaDataPacket binding location BnLc kMetaDataPacketObjectScriptElementc_AGMBlackBoxBase object: “swatch”, 'swch', kSwatchObjectScriptElementParents:• "application", 'null', kApplicationObjectScriptElement• "document", 'docu', kDocumentObjectScriptElementProperties:• "contents version", 'pvrs', kAGMBlackBoxVersionScriptElement• "contents type", 'bbtp', kAGMBlackBoxTypeScriptElement• "spot color list", 'spcl', kSpotListPropertyScriptElement• "contents", 'pcnt', kAGMBlackBoxContentsScriptElement• "contents encoding", 'bben', kAGMBlackBoxEncodingScriptElement• "contents matrix", 'bbmx', kAGMBlackBoxMatrixScriptElementc_EPSTextBase object: "page item", 'pitm', kPageItemObjectScriptElement<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 23


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Parents:• "spread", 'sprd', kSpreadObjectScriptElement• "master spread", 'mspr', kMasterSpreadObjectScriptElement• "page item", 'pitm', kPageItemObjectScriptElement• "oval", 'covl', kOvalObjectScriptElement• "rectangle", 'crec', kRectangleObjectScriptElement• "polygon", 'cpgn', kPolygonObjectScriptElement• "graphic line", 'glin', kGraphicLineObjectScriptElement• "group", 'grop', kGroupObjectScriptElement• "state", 'APrc', kAppearanceObjectScriptElement• "document", 'docu', kDocumentObjectScriptElement• "layer", 'layr', kLayerObjectScriptElement• "page", 'page', kPageObjectScriptElement• "button", 'Push', kPushButtonObjectScriptElement• "text frame", 'txtf', kTextFrameObjectScriptElement• "story", 'cflo' , kStoryObjectScriptElement• "text", 'ctxt', kTextObjectScriptElement• "character", 'cha ', CharacterObjectScriptElement• "word", 'cwor', kWordObjectScriptElement• "line", 'clin', kLineObjectScriptElement• "text column", 'Ccol', kTextColumnObjectScriptElement• "paragraph", 'cpar', kParagraphObjectScriptElement• "text style range", 'txsr', kTextStyleRangeObjectScriptElement• "cell", 'ccel', kCellObjectScriptElement• "table", 'ctbl', kTableObjectScriptElement• "insertion point", 'cins' , kInsertionPointObjectScriptElementProperties:• "item geometry", 'IGeo', kItemGeometryPropertyScriptElement• "EPS text data", 'ETFC', kEPSTextDataPropertyScriptElement• "EPS text attribute bounds", 'ETSC', kEPSTextAttrBoundPropertyScriptElementc_XMLStoryBase object: "story", 'cflo', kStoryObjectScriptElementParents:• "document", 'docu', kDocumentObjectScriptElement24


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>ScriptID values used only in the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Children:• "text", 'ctxt', kTextObjectScriptElement• "character", 'cha ', kCharacterObjectScriptElement• "word", 'cwor', kWordObjectScriptElement• "line", 'clin', kLineObjectScriptElement• "text column", 'Ccol', kTextColumnObjectScriptElement• "paragraph", 'cpar', kParagraphObjectScriptElement• "insertion point", 'cins', kInsertionPointObjectScriptElement• "text style range", 'txsr', kTextStyleRangeObjectScriptElement• "table", 'ctbl', kTableObjectScriptElement• "page item", 'pitm', kPageItemObjectScriptElement• "story preference", 'SyPf', kStoryPrefsObjectScriptElement• "grid data in<strong>format</strong>ion", 'Jgda', kGridDataObjectScriptElement• "metadata packet preference", 'cMep', kMetaDataPacketObjectScriptElementProperties:• "metadata packet", 'pMep', kMetaDataPacketPropertyScriptElement• "lock state", 'lckS', kLockStatePropertyScriptElement• "associated XML elements", 'Xans', kAssociatedXMLElementsPropertyScriptElementc_MetaDataPacketBase object: "preferences object", 'PObj', kPreferencesObjectScriptElementParents:• "document", 'docu', kDocumentObjectScriptElement• "graphic", 'Grfc', kGraphicObjectScriptElement• "image", 'imag', kImageObjectScriptElement• "EPS", 'EPS ', kEPSObjectScriptElement• "WMF", 'WMF ', kWMFObjectScriptElement• "PICT", 'PICT', kPICTObjectScriptElement• "PDF", 'PDF ', kPDFObjectScriptElement• "story", 'cflo', kStoryObjectScriptElement• "xml story", 'cxst' kXMLStoryObjectScriptElementProperties:• "contents", 'pcnt', kAGMBlackBoxContentsScriptElement<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 25


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>NotesNotesPay 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 anexisting plug-in is removed, the scripting DOM can change, which changes the <strong>INX</strong> <strong>file</strong> structure.Some in<strong>format</strong>ion is encoded and written as a block; accidentally overwriting it could changethe embedded images, sounds, video, and so on.XML tags and enumerations in values are keywords to import <strong>INX</strong>; accidentally changing keywordscould cause the <strong>file</strong> to fail to import.There is no definitive structure of <strong>INX</strong> <strong>file</strong>s. There is no XML schema or anything like that thatdescribes the structure. However, if you have the debug version of InDesign, you may chooseTest > Diagnostics > <strong>INX</strong> DTD > Generate to generate a DTD of the current scripting DOMtree. Just keep in mind that this is for in<strong>format</strong>ion only, and you are not supposed to validate<strong>INX</strong> against this DTD.Appendix A: Attribute valuesEBNFNon-terminalsThis section uses Extended Backus-Naur Form (EBNF) to represent the syntax of attribute values.( ) Group{ } Zero or more repetitions[ ] Optional| ChoiceAttribute_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_valueValue_list ::= General_list | Object_list | Record_listGeneral_list ::= Type_list Separator List_count { Separator Simple_value }26


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Appendix A: Attribute valuesTerminalsRecord_list ::= Type_record Separator List_count { Separator Record_item_key SeparatorSimple_value }Object_list ::= Type_object_list Separator List_count { Separator Object_value }Empty_value ::= Type_empty SeparatorBoolean_value ::= Type_boolean Separator ( True | False )String_value ::= Type_string Separator StringStringKey_value ::= Type_stringkey Separator StringInt16_value ::=Type_int16 Separator Hex_stringInt32_value ::= Type_int32 Separator Hex_stringInt64_value ::= Type_int64 Separator Bit64_stringReadable_Double_value ::= Type_readable_double Separator Double_stringAlt_Double_value ::= Type_alt_double Separator Bit64_stringObject_value ::= Type_object Separator StringReadable_Date_value ::= Type_readable_date Separator Date_stringAlt_Date_value ::= Type_alt_date Separator Bit64_stringFile_value ::= Type_<strong>file</strong> Separator StringEnum_value ::= Type_enum Separator String (see Note 5)Readable_Unit_value ::= Type_readable_unit Separator Double_stringAlt_Unit_value ::= Type_alt_unit Separator Bit64_stringList_count ::= Hex_stringRecord_item_key ::= Hex_stringString ::= text <strong>with</strong> 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 }Read_only ::= rType_empty ::= 0Type_boolean ::= bType_string ::= c<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 27


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Appendix A: Attribute valuesNotesType_stringkey ::= kType_int16 ::= sType_int32 ::= lType_int64 ::= LType_readable_double ::= DType_alt_double ::= dType_object ::= oType_readable_date ::= TType_alt_date ::= tType_<strong>file</strong> ::= fType_enum ::= eType_readable_unit ::= UType_alt_unit ::= uType_list ::= xType_object_list ::= yType_record ::= zSeparator ::= _True ::= tFalse ::= fDecimal_char ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9Hex_char ::= Decimal_char | a | b | c | d | e | fBit_separator ::= ~1. A string can contain anything (including white space) except a separator (“_”). If a separatoroccurs in the string, it is replaced by a separator sequence (“~sep~”). You should checkfor this sequence and replace it <strong>with</strong> 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 ‘:’ ss4. 64-bit values are stored as two 32-bit components, the high-order 32-bits, a “~“, followed bythe low-order 32-bits. This separator prevents having to write a fixed number of hex digitsfor each component.5. The "String" in enum value is a four-character ScriptID representing the enumeration value.28


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Appendix B: Objects <strong>with</strong> ordered childrenAppendix B: Objects <strong>with</strong> ordered childrenDocumentThe 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;SpreadThe 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)<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong> 29


<strong>Working</strong> <strong>with</strong> the <strong>INX</strong> <strong>file</strong> <strong>format</strong>Appendix B: Objects <strong>with</strong> ordered childrenTableThe table children appear in the following order:Table rows (c_TableRow, 'crow');Table columns(c_TableColumn, 'ccol');All other remaining children;StoryThe 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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!