Stack and Composite Object Operators

Operators for Manipulating Values on the Operand Stack

ClearStack

The ClearStack operator takes no operands and returns no results. The effect of the ClearStack operator is to remove all values from the stack.

ClearToMark

The ClearToMark operator takes no operands and returns no results. The effect of the ClearToMark operator is to remove from the stack all values above the highest Mark, and to remove the Mark as well. If there is no Mark object on the stack, RaiseError shall be invoked with UnmatchedMark as its operand.

ConvertToExecutable

The ConvertToExecutable operator takes a single operand,

  • <x: VectorReference or Identifier>
  • and returns a single result
  • <x: Procedure or Identifier>
  • where the result x has its executability attribute set to executable (see for a discussion of the executability attribute). VectorReferences with an executability attribute of executable are known by the type Procedure.

    ConvertToIdentifier

    The ConvertToIdentifier operator takes a single operand,

  • <x: Name or OctetStringReference>
  • and returns a single result
  • <id: Identifier>
  • If the operand is of type Name, it is simply returned.

    If the operand is of type OctetStringReference, the octets of the referenced OctetString are interpreted as a sequence of ISO 646-encoded characters and the result is the unique Identifier that corresponds to this sequence of octets (see ).

    ConvertToInteger

    The ConvertToInteger operator takes a single operand,

  • <x: Number or OctetStringReference>
  • and returns a single result
  • <int: Integer>
  • If the operand is of type Integer, it is simply returned.

    If the operand is of type Real, its value is truncated as though by the Truncate operator and the resultant integer value returned.

    If the operand is of type OctetStringReference, each octet of the referenced OctetString is interpreted as an ISO 646-encoded character. The characters are interpreted as a number as if encountered in clear text content; the resultant Real or Integer operand is then interpreted as above. If the OctetString does not correctly encode a Real or Integer as specified in the Content Representation and Interchange Format, RaiseError shall be invoked with SyntaxError as its operand.

    ConvertToReal

    The ConvertToReal operator takes a single operand,

  • <x: Number or OctetStringReference>
  • and returns a single result
  • <real: Real>
  • If the operand is of type Integer, it is converted to a Real and returned.

    If the operand is of type Real, it is simply returned.

    If the operand is of type OctetStringReference, each octet of the referenced OctetString is interpreted as an ISO 646-encoded character. The characters are interpreted as a number as if encountered in clear text content; the resultant Real or Integer operand is then interpreted as above. If the OctetString does not correctly encode a Real or Integer as specified in the Content Representation and Interchange Format, RaiseError shall be invoked with SyntaxError as its operand.

    ConvertToString

    The ConvertToString operator takes two operands,

  • <S: OctetStringReference> <x: Any>
  • and returns a single result
  • <newS: OctetStringReference>
  • The ConvertToString operator overwrites the operand S with an OctetString representation of the operand x; the return value newS is a new OctetStringReference that references the portion of the operand S that was overwritten.

    If the operand x is of type Number, the contents of newS are such that the characters, if encountered in the Clear Text Representation and Interchange Format for content, would result in the value represented by x being pushed onto the operand stack. Operands of type Real are converted to the exponential representation described in using a lower case "e".

    If the operand is of type Identifier, the contents of newS are an OctetString containing the sequence of octets that corresponds to the Identifier.

    If the operand is of type Operator, the Identifier to which the Operator is bound in SystemDict is converted to an OctetString as described above.

    If the operand is of type OctetStringReference, the referenced OctetString is copied into S.

    If the operand is of type Boolean, the contents of newS are the OctetString true or the OctetString false, as appropriate to the value of x.

    If the operand is of any other type, the contents of newS is the OctetString "--nostringval--".

    Copy

    Copy for n operand stack elements

    The Copy operator takes n+1 operands, where n is the value on the top of the operand stack:

  • <n: Cardinal>
  • <xn-1: Any>
  • . . .
  • <x1: Any>
  • <x0: Any> and returns 2n results
  • <xn-1: Any>
  • . . .
  • <x1: Any>
  • <x0: Any>
  • <xn-1: Any>
  • . . .
  • <x1: Any>
  • <x0: Any> The top operand n is popped to determine the number of values to copy, then the remaining n operands are popped and pushed back onto the stack, and finally the same n elements are pushed onto the stack again in the same order.

    Copy for Vectors, Dictionaries, and OctetStrings

    The Copy operator takes two operands

  • <x1: VectorReference, DictionaryReference, or OctetStringReference>
  • <x0: VectorReference, DictionaryReference, or OctetStringReference> and returns a single result
  • <x2: VectorReference, DictionaryReference, or OctetStringReference> Both operands shall be of the same type. All elements of the object referenced by x0 are copied into the object referenced by x1. The object referenced by x1 shall be at least large enough to contain all the elements of the object referenced by x0.

    If the operands are DictionaryReferences, the Dictionary referenced by x1shall be empty, and the returned value is the DictionaryReference operand x1.

    If the operands are OctetStringReferences or VectorReferences, any elements of x1 not overwritten by elements from x0 remain unaffected, and the returned value is a OctetStringReference or VectorReference to a newly-created OctetString or Vector whose length is the same as the length of the object referenced by x0, and whose contents are identical to those of x0.

    Count

    The Count operator takes no operands and returns a single result

  • <n: Cardinal> where n is the number of values on the stack.

    CountToMark

    The CountToMark operator takes no operands and returns a single result

  • <n: Cardinal> where n is the number of values on the stack above the highest Mark. If there is no Mark object on the stack, RaiseError shall be invoked with UnmatchedMark as its operand.

    Dup

    The Dup operator takes a single operand,

  • <x: Any> and returns two results
  • <x: Any>
  • <x: Any> The top element of the stack is duplicated with no other effects.

    Exchange

    The Exchange operator takes two operands,

  • <y: Any>
  • <x: Any> and returns two results
  • <x: Any>
  • <y: Any> The top two elements of the stack are exchanged with no other effects.

    Index

    The Index operator takes n+2 operands, where n is the value on the top of the Operand Stack:

  • <n: Cardinal>
  • <xn: Any>
  • <xn-1: Any>
  • <xn-2: Any>
  • . . .
  • <x1: Any>
  • <x0: Any> and returns n+1 results:
  • <x0: Any>
  • <xn: Any>
  • <xn-1: Any>
  • <xn-2: Any>
  • . . .
  • <x1: Any>
  • <x0: Any> The result is produced by popping n off the stack, then find the nth element down (counting the top element of the stack as the 0th element) on the stack and copy it onto the top of the stack. the expression {<x0: Any> <0: Cardinal> Index } is equivalent to {<x0: Any> Dup }.

    Mark

    The Mark operator takes no operands and returns a single result

  • <mark: Mark> The only effect of the Mark operator is to push a Mark object on the stack.

    Pop

    The Pop operator takes a single operand,

  • <x: Any> and returns no results. The only effect is the removal of the top element from the stack.

    Roll

    The Roll operator takes n+2 operands, where n is the value on the top of the Operand Stack:

  • <m: Integer>
  • <n: Cardinal>
  • <xn-1: Any>
  • <xn-2: Any>
  • . . .
  • <x1: Any>
  • <x0: Any> and returns n results. The top two operands m and n are popped to determine the number of values to shift (n), direction of shift (sign of m), and the number of positions by which to shift them (m). Then the remaining n operands are popped, a circular shift of these n values is performed, and the shifted sequence of values is pushed back onto the stack.

    If the value of m is positive, shifting by one position is equivalent to removing the top element of the sequence of values, inserting it at the bottom of the sequence, and moving all intervening values one level higher in the stack:

  • <xn-2: Any>
  • . . .
  • <x1: Any>
  • <x0: Any>
  • <xn-1: Any>

    If the value of m is negative, shifting by one position is equivalent to removing the bottom element of the sequence of values, moving all values above it one level lower in the stack, and pushing the removed element onto the top of the stack:

  • <x0: Any>
  • <xn-1: Any>
  • <xn-2: Any>
  • . . .
  • <x1: Any> Shifting by m is equivalent to performing the shift by one position m times.

    Type

    The Type operator takes a single operand,

  • <x: Any> and returns a single result
  • <t: Identifier> where t identifies the base type of the operand x and is one of the following:
    • Boolean
    • Dictionary
    • Identifier
    • Integer
    • Mark
    • Null
    • OctetString
    • Operator
    • Path
    • Real
    • SaveObject
    • StreamObject
    • Vector

    Operators for Manipulating Dictionaries, Vectors, and OctetStrings

    AnchorSearch

    The AnchorSearch operator takes two operands

  • <search: OctetStringReference>
  • <string: OctetStringReference> and returns either two or three results, depending on whether or not the initial substring of the OctetString referenced by string matches the OctetString referenced by search. If the initial substring of the OctetString referenced by string does match the search string, AnchorSearch returns three results
  • <true: Boolean>
  • <match: OctetStringReference>
  • <post: OctetStringReference> where match is a reference to the initial substring of the OctetString referenced by string that was matched, and post is a reference to the unmatched remainder of the OctetString referenced by string. If the search string does not match the initial substring of the OctetString referenced by string, AnchorSearch returns two results
  • <false: Boolean>
  • <string: OctetStringReference> where string is a reference to the original OctetString being searched. In either case, the top element of the stack after the execution of AnchorSearch is a Boolean. The value of the Boolean is true if the search string matches the initial substring of the string being searched, and false otherwise.

    Capacity

    The Capacity operator takes a single operand

  • <x: VectorReference, DictionaryReference, or OctetStringReference> and returns a single result
  • <capacity: Cardinal> If x is of type VectorReference or OctetStringReference, the returned value is the number of elements, the capacity, of the object referenced by x.

    If x is of type DictionaryReference, the returned object is the current total number of key/value pairs, the capacity, that can be stored in the Dictionary referenced by x.

    ContextStack

    The ContextStack operator takes a single operand

  • <V: VectorReference> and returns a single result
  • <V: VectorReference> The ContextStack operator enumerates the Dictionaries on the context stack into the Vector referenced by the operand VectorReference V. If n is the number of Dictionaries on the context stack, the returned VectorReference V is a reference to the subvector of the original Vector containing n elements, each of which is of type DictionaryReference. The element of the Vector referenced by the returned VectorReference V whose index is 0 contains a reference to the bottom most Dictionary on the context stack, and the element whose index is n-1 contains a reference to the topmost Dictionary on the context stack. If the length of the Vector referenced by the operand VectorReference V is less than the depth of the context stack, RaiseError shall be invoked with RangeCheck as its operand.

    Define

    The Define operator takes two operands

  • <new: Any>
  • <key: DictionaryKey> and returns no results. The Define operator modifies the topmost Dictionary on the context stack. The Dictionary is searched for any key/value pair for which the key is equal to key. If any such pair is found, the value to which the name is bound is replaced by new.

    If no key/value pair is found whose key is equal to key, the key/value pair (key, new) is added to the Dictionary. If the Dictionary currently has as many pairs as its capacity, the capacity is increased by at least one. If this would increase the capacity beyond the implementation limit on dictionary size, then RaiseError is invoked with LimitCheck as its operand. Names bound in Dictionaries may be used as executable Names in content, as described in .

    EntriesUsed

    The EntriesUsed operator takes a single operand

  • <x: DictionaryReference> and returns a single result
  • <entries: Cardinal> where the returned value is the number of key/value pairs currently defined in the Dictionary referenced by x (as opposed to the current capacity of the Dictionary).

    Get

    The Get operator takes two operands

  • <key: Cardinal or DictionaryKey>
  • <x: VectorReference, DictionaryReference, or OctetStringReference> and returns a single result
  • <value: Any> If x is a VectorReference or OctetStringReference, key shall be of type Cardinal, and the value returned is the element of the object referenced by x whose index is key. If key is greater than or equal to the length of the object, or if it is negative, RaiseError shall be invoked with RangeCheck as its operand.

    If x is a DictionaryReference the value returned is the value bound to key in the Dictionary referenced by x. If key is not in the Dictionary, RaiseError shall be invoked with UndefinedKey as its operand.

    GetCurrentDictionary

    The GetCurrentDictionary operator takes no operands and returns a single result

  • <DictRef: DictionaryReference> The returned DictionaryReference is a reference to the Dictionary on the top of the current Context Stack. The Context Stack is unchanged by this operation.

    GetInterval

    The GetInterval operator takes three operands

  • <count: Cardinal>
  • <index: Cardinal>
  • <x: VectorReference or OctetStringReference> and returns a single result
  • <interval: VectorReference or OctetStringReference> The interval returned is of the same type as the operand x, the object it references is of length count, and its elements are composed of the subsequence of the object referenced by x beginning with the element whose index is index and continuing for count elements.

    If index is not a valid index into the original Vector or OctetString, or if index+count is greater than the length of the original Vector or OctetString, RaiseError shall be invoked with RangeCheck as its operand.

    GetTest

    The GetTest operator takes two operands

  • <key: DictionaryKey>
  • <DictRef: DictionaryReference> and returns a single result
  • <found: Boolean> GetTest returns a Boolean value of true if there exists a key/value pair in the Dictionary referenced by DictRef for which the key is key, and returns a value of false otherwise.

    GetValue

    The GetValue operator takes a single operand

  • <key: DictionaryKey> and returns a single result
  • <value: Any> The value returned is determined by the context stack, in the context of interpretation. The Dictionaries on the context stack are examined in order, starting with the top Dictionary on the context stack. The topmost Dictionary which contains the DictionaryKey key will be used to determine the value bound to key in that Dictionary. This value will be returned on the operand stack. If key is not contained in any of the Dictionaries on the context stack, RaiseError shall be invoked with UndefinedKey as its operand.

    GetValueTest

    The GetValueTest operator takes a single operand

  • <key: DictionaryKey> The value returned is determined by the context stack, in the context of interpretation. The Dictionaries on the context stack are examined in order, starting with the top Dictionary on the context stack. If a Dictionary is found which contains the DictionaryKey key, the GetValueTest operator returns two results
  • <true: Boolean>
  • <DictRef: DictionaryReference> where DictRef is a reference to the Dictionary containing key. If key is not in any Dictionary on the context stack, GetValueTest returns the single result
  • <false: Boolean> In either case, the top element of the stack after the execution of GetValueTest is a Boolean. The value of the Boolean is true if key is in any Dictionary on the context stack and is false otherwise.

    MakeDictionary

    The MakeDictionary operator takes a single operand

  • <size: Cardinal> and returns a single result
  • <DictRef: DictionaryReference> where DictRef is a new empty Dictionary with a maximum capacity of size key/value pairs. Names bound in Dictionaries may be used as executable Names in content, as described in .

    MakeString

    The MakeString operator takes a single operand

  • <n: Cardinal> and returns a single result
  • <S: OctetStringReference> where n is the number of elements in the newly-created OctetString referenced by S. The MakeString operator initializes each element of the new OctetString with the value 0.

    MakeVector

    The MakeVector operator takes a single operand

  • <n: Cardinal> and returns a single result
  • <V: VectorReference> where n is the number of elements in the newly-created Vector referenced by V. The MakeVector operator initializes each element of V with the object of type Null.

    MakeandStoreDictionary

    The MakeandStoreDictionary operator takes (n × 2)+1 operands, where the first operand on the operand stack is an object of type Mark, and the remaining n × 2 operands represent n key/value pairs:

  • <valuen-1: Any>
  • <keyn-1: Any>
  • <valuen-2: Any>
  • <keyn-2: Any>
  • . . .
  • <value0: Any>
  • <key0: Any>
  • <mark: Mark> and returns a single result
  • <DictRef: DictionaryReference> The number of values above the mark (n × 2) is determined, and a Dictionary of capacity n is created. The n key/value pairs on the stack are then removed and stored into the Dictionary. All operands, including the Mark, are removed from the stack by the MakeandStoreDictionary operator. If there is no Mark object on the stack, RaiseError shall be invoked with UnmatchedMark as its operand.

    MakeandStoreVector

    The MakeandStoreVector operator takes a list of n+1 operands, where the first operand on the operand stack is an object of type Mark:

  • <valuen-1: Any>
  • . . .
  • <value1: Any>
  • <value0: Any>
  • <mark: Mark> and returns a single result
  • <V: VectorReference> The number of values above the mark (n) is determined, and a Vector of length n is created. The n values on the stack are then removed and stored into the Vector; the topmost value is stored into element n-1 of the Vector, and the bottom most value is stored into element 0 of the Vector. All operands, including the Mark, are removed from the stack by the MakeandStoreVector operator. If there is no Mark object on the stack, RaiseError shall be invoked with UnmatchedMark as its operand.

    PopContextStack

    The PopContextStack operator takes no operands and returns no results. The effect of interpreting the PopContextStack operator is to remove the topmost Dictionary from the context stack. If the context stack is in its initial state, consisting only of the default context stack, RaiseError shall be invoked with ContextStackUnderflow as its operand.

    PushContextStack

    The PushContextStack operator takes a single operand

  • <DictRef: DictionaryReference> and returns no results. The effect of interpreting the PushContextStack operator is to push the Dictionary referenced by DictRef onto the context stack, thereby making it the first Dictionary searched in the current context of execution. If the implementation-dependent maximum number of DictionaryReferences on the context stack would be exceeded by this operation, RaiseError shall be invoked with ContextStackOverflow as its operand.

    Put

    The Put operator takes three operands

  • <new: Any>
  • <key: DictionaryKey>
  • <x: VectorReference, DictionaryReference, or OctetStringReference> and returns no results; it replaces a single element of a Vector, Dictionary, or OctetString.

    If x is a VectorReference or OctetStringReference, the operand key shall be of type Cardinal, new is the new value to be placed at the location indexed by key, and the element of the object referenced by x whose index is key is replaced by new. If key is greater than or equal to the number of elements in the object referenced by x, RaiseError shall be invoked with RangeCheck as its operand.

    If x is a DictionaryReference the Put operator modifies the Dictionary referenced by x as follows: First, the Dictionary is searched for any key/value pair for which the key is equal to key. If any such pair is found, it is removed from the Dictionary. Second, the key/value pair (key, new) is added to the Dictionary. If no key/value pair was found and removed, and if the Dictionary currently has as many pairs as its capacity, the capacity is increased by at least one. If adding this pair would increase the capacity beyond the implementation limit on dictionary size, then RaiseError is invoked with LimitCheck as its operand. Names bound in Dictionaries may be used as executable Names in content, as described in .

    PutInterval

    The PutInterval operator takes three operands

  • <y: VectorReference or OctetStringReference>
  • <index: Cardinal>
  • <x: VectorReference or OctetStringReference> and returns no results. x and y shall be of the same type. The effect is to replace the subsequence of the object referenced by x beginning with the element whose index is index and extending for the length of y elements with the contents of y.

    If index is not a valid index into x, or if x is not large enough to contain all of y beginning at the position indicated by index, RaiseError shall be invoked with RangeCheck as its operand.

    PutValue

    The PutValue operator takes two operands

  • <new: Any>
  • <key: DictionaryKey> and returns no results. The effect of the PutValue operator is determined by the context stack, in the context of interpretation. The Dictionaries on the context stack are examined in order, starting with the top Dictionary on the context stack. The topmost Dictionary which contains the DictionaryKey key is altered such that the value to which key is bound is replaced by the new value new. If key is not contained in any of the Dictionaries on the context stack, the PutValue operator implicitly executes the Define operator to define the key/value pair (key, new) into the topmost Dictionary on the context stack, increasing the capacity of that Dictionary if necessary.

    Search

    The Search operator takes two operands

  • <search: OctetStringReference>
  • <string: OctetStringReference> and returns either two or four results, depending on whether or not a substring of the OctetString referenced by string matches search. If a substring of the OctetString referenced by string does match the search string, Search returns four results
  • <true: Boolean>
  • <pre: OctetStringReference>
  • <match: OctetStringReference>
  • <post: OctetStringReference> where match is a reference to the first substring of the OctetString referenced by string that was matched, pre is a reference to the substring of the OctetString referenced by string before the matched substring, and post is a reference to the unmatched remainder of the OctetString referenced by string after the matched substring. If the search string does not match any substring of the OctetString referenced by string, Search returns two results
  • <false: Boolean>
  • <string: OctetStringReference> where string is a reference to the original string being searched. In either case, the top element of the stack after the execution of Search is a Boolean. The value of the Boolean is true if the search string matches a substring of the string being searched, and false otherwise.

    StoreVector

    The StoreVector operator takes n+1 operands, where n is the length of the Vector referenced by the operand VectorReference V:

  • <V: VectorReference>
  • <valuen-1: Any>
  • . . .
  • <value1: Any>
  • <value0: Any> and returns a single result
  • <V: VectorReference> The VectorReference V is popped from the stack, and its size (n) determined. The topmost n values on the stack are then removed and stored into the Vector referenced by V; the topmost value is stored into element n-1 of the Vector referenced by V, and the bottom most value is stored into element 0 of the Vector referenced by V. V is then pushed back onto the stack. If the stack does not have at least n values, then RaiseError shall be invoked with StackUnderflow as its operand.

    VectorLoad

    The VectorLoad operator takes a single operand

  • <V: VectorReference> and returns n+1 results, where n is the length of the Vector V:
  • <V: VectorReference>
  • <valuen-1: Any>
  • . . .
  • <value1: Any>
  • <value0: Any> The VectorReference V is popped from the stack, then the elements of the Vector referenced by V are successively pushed onto the operand stack, beginning with the element whose index is 0, and finally V is pushed back onto the stack.

    Attribute and Resource Operators

    CheckIfExecutable

    The CheckIfExecutable operator takes one operand

  • <x: VectorReference or Identifier> and returns one result
  • <ex: Boolean> where ex is false if the executability attribute of x is literal and true if the executability attribute of x is executable. See for a discussion of the executability attribute.

    CheckIfReadable

    The CheckIfReadable operator takes one operand

  • <x: DictionaryReference, OctetStringReference, or VectorReference> and returns one result
  • <r: Boolean> where r has value true if the access attribute of x is ReadWrite or ReadOnly., and false if the access attribute of x is ExecuteOnly or NoAccess. See for a discussion of the access attribute.

    CheckIfWriteable

    The CheckIfWriteable operator takes one operand

  • <x: DictionaryReference, OctetStringReference, or VectorReference> and returns one result
  • <w: Boolean> where w has value true if the access attribute of x is ReadWrite, and false if the access attribute of x is ReadOnly, ExecuteOnly or NoAccess. See for a discussion of the access attribute.

    FindResource

    The FindResource operator takes two operands

  • <restype: Name>
  • <ID: Identifier> and returns one result. restype specifies the type of resource to be found, and shall be one of the following literal Names:
    • ColorSpace
    • DataSource
    • Filter
    • FontIndexMap
    • Form
    • GlyphIndexMap
    • IndexedFont
    • Pattern

    The returned result depends upon restype. The type and nature of the returned result for each resource type is specified in the following subclauses:

    Color Space

    If restype is <ColorSpace: Name>, FindResource returns the Color Space Object that is bound to ID in the set of Declared Resources. The format and contents of the Color Space Object are as described in . Within this Color Space Object, the Color Space Family is represented by a value of type OctetStringReference with an access attribute of ReadOnly. The OctetString contains the canonical character string form of the Public Object Identifier for the Color Space Family Identifier (see ). This International Standard requires (see ) that any Color Space Object used in content shall have been obtained using FindResource. It is the obligation of the implementation to enforce this requirement. One way this can be done is to record the all the references to Color space Objects that have been returned by FindResource, then allow only Color Space Object that have references that are in the set of returned object references to be used as Color Space Objects. The OctetStringReferences for the Color Space Family Identifier of the Color Space Object can be treated similarly.

    Data Source

    If restype is <DataSource: Name>, FindResource returns the value of type StreamObject that is bound to ID in the set of Declared Resources. and describes the different kinds of Data Sources and the Filter, if any, which is applied to each one by the FindResource operator.

    Filter

    If restype is <Filter: Name>, FindResource returns a value of type OctetStringReference with an access attribute of ReadOnly that is bound to ID in the set of Declared Resources. The OctetString contains the canonical character string form of the Public Object Identifier for the Filter Name. Filter Identifiers are specified in and in . This International Standard requires (see ) that the Filter Identifier operand of the Filter operator shall have a Filter Identifier that has been obtained using FindResource. It is the obligation of the implementation to enforce this requirement. One way this can be done is to record the all the OctetStringReferences that have been returned by FindResource, then allow only OctetStringReferences that are in the set of returned object references to be used as Filter Identifiers.

    Font Index Map

    If restype is <FontIndexMap: Name>, FindResource returns the Font Index Map that is bound to ID in the set of Declared Resources. The Font Index Map is an object of type VectorReference. The format and contents of the referenced Vector are as described in .

    Form

    If restype is <Form: Name>, FindResource returns a value of type Form Object that is bound to ID in the set of Declared Resources. The Form Object is described in clause . This International Standard requires (see ) that the Form Object which is the operand of the ExecuteForm operator is obtained via execution of the FindResource operator. It is the obligation of the implementation to enforce this requirement. One way this can be done is to record the all the DictionaryReferences that have been returned by FindResource, then allow only DictionaryReferences that are in the set of returned object references to be used as Form Objects.

    Glyph Index Map

    If restype is <GlyphIndexMap: Name>, FindResource returns the Glyph Index Map that is bound to ID in the set of Declared Resources. The Glyph Index Map is an object of type VectorReference. The format and contents of the referenced Vector are as described in .

    Indexed Font

    If restype is <IndexedFont: Name>, FindResource returns a value of type IndexedFont that is bound to ID in the set of Declared Resources. Indexed Fonts are described in .

    Pattern

    If restype is <Pattern: Name>, FindResource returns a value of type Pattern Object that is bound to ID in the set of Declared Resources. The Pattern Object is described in . This International Standard requires (see ) that the PatternDictionary which is the operand of the MakePattern operator is obtained via execution of the FindResource operator. It is the obligation of the implementation to enforce this requirement. One way this can be done is to record the all the DictionaryReferences that have been returned by FindResource, then allow only DictionaryReferences that are in the set of returned object references to be used as PatternDictionaries.

    Otherwise

    If the value of restype is not one of these Names, RaiseError shall be invoked with UndefinedKey as its operand. ID is the value of an INTERNAL RESOURCE IDENTIFIER that has been bound in structure to a resource via a RESOURCE DECLARATION. If there is no resource of type restype which is bound to ID, RaiseError shall be invoked with UndefinedResource as its operand.

    QueryResource

    The QueryResource operator takes two operands

  • <restype: Name>
  • <ID: Identifier> and returns one result.
  • <known: Boolean> restype specifies the type of resource to be found, and shall be one of the following literal Names:
    • ColorSpace
    • DataSource
    • Filter
    • IndexedFont
    • Form
    • GlyphIndexMap
    • FontIndexMap
    • Pattern

    If the value of restype is not one of these Names, RaiseError shall be invoked with UndefinedKey as its operand. ID is the value of an INTERNAL RESOURCE IDENTIFIER that has been bound in structure to a resource via a RESOURCE DECLARATION. If there is a resource of type restype which is bound to ID, known, the return value of QueryResource, shall be true; otherwise known shall be false. QueryResource can be used to determine if a resource is defined and declared under a given Name, thus being able to detect if FindResource will do any substitutions for the requested resource. For example, a FindResource on an IndexedFont will never fail; some font will be substituted by the implementation.

    MakeReadOnly

    The MakeReadOnly operator takes one operand

  • <x: DictionaryReference, OctetStringReference, or VectorReference> and returns one result
  • <x: DictionaryReference, OctetStringReference, or VectorReference> MakeReadOnly reduces the access attribute of its operand to ReadOnly. If the access attribute of the operand is ExecuteOnly, RaiseError shall be invoked with InvalidAccess as its operand. See for a discussion of the access attribute.

    MakeExecuteOnly

    The MakeExecuteOnly operator takes one operand

  • <x: DictionaryReference, OctetStringReference, or VectorReference> and returns one result
  • <x: DictionaryReference, OctetStringReference, or VectorReference> MakeExecuteOnly reduces the access attribute of its operand to ExecuteOnly. See for a discussion of the access attribute.