Content Data Types

This Clause defines the types of objects that can occur in the processing of content. These types include some, but not all, of the types defined in Clause 6. Those types which can occur are explicitly specified below. Only types defined or referenced in this Clause may occur in the processing of content values.

Each of the objects processed by the SPDL virtual machine has an associated object type. The structure of the type system is described in . This type system was extended in with the introduction of composite objects and object references. Values and composite objects are subclasses of the class of objects. Object references are a subclass of values.

Composite objects are containers for values, both simple values and object references. Composite objects are identified by object references. Thus, one composite object may refer to another. The composite object types are described in . Every composite object type implicitly defines a corresponding object reference type. No separate definition will be given for the object reference type that references a given composite object type.

There are some object reference types that refer to a subset of a composite object type. For these object references an explicit definition is given in .

The subset of object types which have a literal representation in the Content Interchange Format is specified in and . Those types which do not have a literal representation in the Content Representation and Interchange Format are also listed in .

Value types

The value types include the simple value types and the object reference types. Some of the types of simple values used in Structure are also used in Content. Such value types are identified here by reference to the definition in . The remaining simple values usable in Content are defined in this The object reference types are defined implicitly in and explicitly in .

Any

The Any type is a super type (see ) of all the content value types, both simple value types and object references. The set of values of the Any type consists of the union of the set of values all the types defined in , and the implied object reference types for the composite objects defined in . Two values of the Any type are equal only if both values are of the same base type and they are equal within that base type.

Boolean

The Boolean type is defined in .

Cardinal

The Cardinal type is defined in .

Dictionary Key

The DictionaryKey type is a super type of the Identifier type (see ) and the Cardinal type. The set of values of the DictionaryKey type consists of the union of the set of values of the Identifier type and the set of values of the Cardinal type. Two values of theDictionaryKey type are equal if and only if they are both of the same base type and are equal as values of that type. As described in , Dictionaries contain key/value pairs. The DictionaryKey type defines the set of values which may be used as the name component of such a key/value pair.

Identifier

The Identifier type is a base type. The set of values of the Identifier type consists of a set of abstract values each of which corresponds to a sequence of octets where each octet represents an ISO 646 character encoding. Two values of the Identifier type are equal if and only if the octet strings corresponding to each value are equal.

A subset of the set of all possible Identifiers may be encoded directly in content (see the subtype Name in ). An Identifier whose value does not conform to the restrictions placed on the Name type may be encoded as an OctetStrings and converted to an Identifier via execution of the ConvertToIdentifier operator.

Integer

The Integer type is defined in .

Mark

The Mark type is a base type. The set of values of the Mark type consists of a single value, the result of the Mark operator. This value may be used to delimit sequences of arguments on the operand stack.

Name

The Name type is a sub-type of the Identifier type. This type represents the subset of the Identifier type which may be encoded directly in content. The set of values of the Name type consists of those abstract values of Identifier type that correspond to an octet string with the following properties: the first octet of the value of the Name shall be the coding of an ISO 646-encoded character from the 26 letter Latin alphabet: "a", "b", "c", . . . , "z"; "A", "B", "C", . . . , "Z"; or a period (fullstop) ".". Each succeeding octet in the sequence may be chosen from the Latin alphabet letters, decimal digits "0", "1", "2", . . . , "9", the underbar "_", the hyphen "-", the colon ":", or the period (fullstop) ".".

In content, an object of Name type may be executable or literal. The processing of each is outlined in and .

Null

The Null type is a base type. The set of values of the Null type consists of a single value, the result of the Null operator. This value is used to initialize the elements of Vectors at the time of their creation by the MakeVector operator.

Number

The Number type is defined in .

Operator

The Operator type is a base type. The set of values of the Operator type consists of a set of values each of which, when executed, causes the virtual machine to perform a specific action or set of actions. Execution of a value of Operator type causes the interpretation of the Operator as outlined in . The semantics of the values of Operator type are defined by this International Standard. Each value of Operator type is the value of a key/value pair in the standard Dictionary, SystemDict. The content of SPDL documents may not create values of Operator type, but may cause Identifiers to be bound to such values.

A value of Operator type is executed by the virtual machine when a Name bound to the object is encountered in content, or when the operand to the Execute operator is an object of Operator type or is an Identifier which is bound to an object of Operator type.

Real

The Real type is defined in .

SaveObject

The SaveObject type is a base type. The set of values of the SaveObject type consists of the results of the SaveState operator. Each such value has all the information necessary to allow the RestoreState operator to restore the Virtual Machine State at the time the SaveState operator was executed and the SaveObject was created.

StreamObject

The StreamObject type is a base type. The set of values of the StreamObject type consists of the results of the Filter operator or of the FindResource operator when used to find a Data Source resource. A value of the StreamObject type provides content-level access to data from Data Source resources or data that is output from filters (see ).

Composite object types

The composite object types define containers which are identified by object references. A composite object shall not be used directly as an operand of a content operator; instead an object reference for the composite object shall be used. The composite object types are explicitly defined in this sub-clause. The definition of the corresponding object reference type is implicit; for each composite object type X there is an object reference type XReference. The composite objects are defined here only as part of the virtual machine model. Like the virtual machine model, they are presented in this International Standard only as a mechanism for defining the semantics of document content. It is not intended to dictate the actual implementation of a document content processor, nor to restrict the method by which document content semantics are realized in a particular implementation.

Dictionary

The Dictionary type is a composite object type. The Dictionary type consists of a set of containers each of which holds a set of key/value pairs. Each key/value pair shall consist of a value of the DictionaryKey type, and another value of the Any type. The first element of each key/value pair is called the key, and the second element is called the value. Within a single Dictionary, no two key/value pairs shall have the same key.

An object <key: DictionaryKey> is said to be in a Dictionary, or a Dictionary is said to contain the <key: DictionaryKey>, if there is an key/value pair in the Dictionary whose key is <key: DictionaryKey>.

If <key: DictionaryKey> is in a Dictionary, then the value bound to key by Dictionary is the value of the key/value pair whose key is key. If the Dictionary containing key is evident from context, then this may be called simply the value bound to key or the value of key.

Dictionaries are created by the MakeDictionary or the MakeandStoreDictionary operator during processing of document content or by the processing of a DICTIONARY RESOURCE SPECIFICATION in structure. Dictionaries are referenced explicitly via a DictionaryReference.

A Dictionary shall have a capacity which shall be the number of pairs the Dictionary can hold. When the Dictionary is created, an initial capacity shall be specified. If the Dictionary already has that many pairs and a pair with a key not already contained in the Dictionary is bound, then the capacity of the Dictionary shall be increased by at least one. The capacity of a Dictionary may be obtained using the Capacity operator. The number of pairs currently contained in the Dictionary may be obtained using the EntriesUsed operator.

An explicitly referenced Dictionary with an access attribute value of ReadWrite may be changed using the Put operator. If the top Dictionary on the Context Stack has an access attribute value of ReadWrite, it may be changed implicitly using the Define operator. In both cases, the value operand shall be bound to the key operand within the specified Dictionary.

Provided that there are no later changes with that same key, that value may be retrieved explicitly by using the Get operator with the key and a reference to the same Dictionary as operands or the GetTest operator may be used to test if the Dictionary contains that key.

If the Dictionary changed using the Put operator is on the Context Stack and no Dictionary higher on the Context Stack contains the same key, then the value may be retrieved implicitly using an executable Name, provided the key is a Name, or it may be retrieved explicitly using the GetValue operator with the key when the key could be any DictionaryKey. The GetValueTest operator may be used to test if the key is contained in a Dictionary on the Context Stack.

OctetString

The OctetString type is a composite object type. The OctetString type consists of a set of containers each of which holds an octet. Each octet is a value of the Cardinal type in the range 0 to 255, inclusive. an octet is also known as an 8-bit byte.

Objects of the OctetString type are created using the MakeString operator. The MakeString operator takes a Cardinal as its operand which specifies the capacity of the OctetString, the number of octets it can hold. The capacity of an OctetString cannot be changed once the OctetString has been created. The Capacity operator returns the capacity of an OctetString.

Given an object reference to an OctetString, the content of the OctetString can be changed an element at a time using the Put operator or a subsequence at a time using the PutInterval operator. The elements can be accessed individually using the Get operator or the GetInterval operator returns an OctetStringReference to a subsequence of an OctetString.

Path

The Path type is a composite object type. The Path type consists of a set of containers each of which holds a sequence of zero or more path segments. Each path segment begins with a start point created by the SetPosition operator (see ) and consists of a sequence of zero or more path elements. A path element is one of:

Path segments and path elements each have a start point and an end point, which are locations in RCS. Points are defined in .

The start point of the first path element in each path segment is the start point of the path segment. The start point of each other path element in the path segment is the end point of the preceding path element.

Each path segment has an end point. If the path segment consists only of a start point, then the end point of that path segment is identical to its start point. If the path segment has one or more path elements, the end point of the path segment is the end point of the last path element in that path segment and the path segment is termed directed, where its direction is defined to be from its start point to its end point.

Each path has a start point, which is the start point of its first path segment. Each path has an end point, which is the end point of its last path segment. As a single exception, a path with no path segments is called a null path, and has no start point or end point. The primary use of Paths is in the construction of geometric graphic imaging elements and clipping regions.

Vector

The Vector type is a composite object type. The Vector type consists of a set of containers each of which holds a sequence of values, termed elements. Each value in the sequence is associated with an index. The index of each element is a Cardinal, between zero and n-1 inclusive, where n is the number of elements in the sequence. The index specifies the position of the element in the sequence. The elements of a Vector are not required to be of the same type.

A Vector may be created using the MakeVector or the MakeandStoreVector operator. It is created with a fixed capacity, n above, that cannot be changed once the Vector is created. The Capacity operator returns the capacity of a Vector.

Given an object reference to a Vector, the content of the Vector can be changed an element at a time using the Put operator or a subsequence at a time using the PutInterval operator. The elements can be accessed individually using the Get operator, or the GetInterval operator returns a VectorReference to a subsequence of a Vector.

Object reference types

In addition to the object reference types defined implicitly with each composite object type, there are several object reference types that refer to a subset of the composite objects in a particular composite object type. These subsets are subtypes of the class of composite objects, but these subtypes will not be given type names of their own. Instead, they will be referred to by the object reference type that refers to the subtype.

Indexed Font

The IndexedFont object reference type represents the subset of the DictionaryReference object type which references Dictionaries containing the information necessary for the presentation of character text using a particular font. IndexedFonts may be constructed by use of the DefineFont, PutWMode, ScaleFont, and TransformFont operators in document content or, by use of the FindFont and FindResource operators, may be selected from the Set of Resources made available through the document structure. An IndexedFont may be used for the rendering of character text by assigning its value to the Graphics State Variable CurrentFont.

Glyph String

The GlyphString object reference type represents the subset of the OctetStringReference object type which is suitable for use as an operand to the ShowString operator. The primary use of GlyphStrings is for the efficient presentation of character text. The elements of the GlyphString are interpreted as a sequence of glyph indices, representing glyphs by reference to the Encoding Vector associated with the CurrentFont.

Procedure

The Procedure object reference type represents the subset of the VectorReference object type in which each VectorReference has an executability attribute that is executable. Procedures may be encoded in the content notation, or may be created by applying the ConvertToExecutable operator to VectorReferences. A Procedure is interpreted when a name bound to the Procedure is encountered in content as an executable Name, or a Procedure may be caused to be interpreted by the Execute operator. See for more details.

Transformation

The Transformation object reference type is the subset of the VectorReference type for which the referenced Vector is of the form:

[ a b c d e f ]

Such a Vector represents a linear mapping from one Cartesian Coordinate System into another, as described below.

All such mappings can be represented in the form:

  • x′ = a×x + c×y + e
  • y′ = b×x + d×y + f

    where a, b, c, d, e, and f are numbers, x and y are coordinates in the first Cartesian Coordinate System, and x′ and y′ are coordinates in the second Cartesian Coordinate System. Any such mapping where a × d - b × c = 0 will be degenerate and non-invertible.

    A particular set of coefficients a, b, c, d, e, and f are said to be associated with a particular transformation, and are also said to define the particular transformation. The coefficients are dimensionless unless the associated transformation is the current value of CurrentTransformation, in which case the coefficients have units of millimeters.

    These equations can also be expressed in the form of a matrix multiplication as

  • [ x' y' 1 ] = [ x y 1 ] × ace bdf 001

    for this reason the matrix M given by

    M = ace bdf 001

    is said to be associated with and to define the transformation TM which is given by the above equations.

    Attributes

    Some SPDL objects have one or two attributes associated with them. The two attributes are an executability attribute, which determines whether the object is treated as data to be pushed onto the operand stack or as an executable object, and an access attribute, which determines whether the value of the object may be explicitly read, written or executed by SPDL content operators.

    Executability Attribute

    The executability attribute is either literal or executable. Only objects of the Identifier, Operator, or VectorReference types have an executability attribute. The executability attribute of objects of the Operator type is always executable. The executability attribute of an object of the Identifier or VectorReference types may explicitly be made executable via execution of the ConvertToExecutable operator.

    Identifiers

    The executability attribute of identifiers created via execution of the ConvertToIdentifier operator is literal at the time of their creation. The executability attribute of Names encountered in the content representation is determined as specified in and and .

    VectorReferences

    The executability attribute of VectorReferences created by the MakeVector operator is literal; their executability attribute can be made executable via execution of the ConvertToExecutable operator. VectorReferences with an executability attribute of executable belong to the Procedure type.

    The attribute applies to the VectorReference, rather than the Vector being referenced. This implies that two VectorReferences, each with a different executability attribute, may reference the same underlying Vector but be treated differently in content.

    Access Attribute

    The access attribute applies only to objects of the Dictionary, OctetStringReference, or VectorReference types. There are four access attributes:

    • ReadWrite - An object referenced via an object reference with an access attribute of ReadWrite may be explicitly read or written in content by operators or it may be executed (if it is executable) by the interpreter. A composite object is written by any operator which modifies the contents of the composite object (see )
    • ReadOnly - An object referenced via an object reference with an access attribute of ReadOnly may be explicitly read, but not explicitly written, in content by operators and it may be executed (if it is executable) by the interpreter.
    • ExecuteOnly - An object referenced via an object reference with an access attribute of ExecuteOnly may not be explicitly read or written in content by operators, but may be executed (if it is executable).
    • NoAccess - An object referenced via an object reference with an access attribute of NoAccess may not be explicitly read or written in content by operators, nor may it be executed.

    New objects of the Dictionary, OctetStringReference, or VectorReference types created in content have an access attribute of ReadWrite unless otherwise specified.

    For objects of the OctetStringReference and VectorReference types, the attribute applies to the reference, rather than the object being referenced (see the discussion under Executability Attribute in ). For objects of the Dictionary type, however, the attribute is directly associated with the Dictionary.

    The access attribute of an object may be reduced by the operators MakeReadOnly, MakeExecuteOnly or NoAccess.