The PostScript implementation in Pajdeg is a simplified interpreter which is used to process e.g. CMap (ToUnicode) content.
A PostScript interpreter environment.
Create a new PostScript environment for interpreting.
- Returns
- A clean environment
Destroy a PostScript environment.
- Parameters
-
pse | Environment that is no longer needed |
Execute the given stream of data of the given length (in bytes), inside the given PostScript environment. The same PostScript environment can be used to execute multiple pieces of data.
- Parameters
-
pse | The PostScript environment |
stream | The stream of ASCII characters representing a PostScript program |
len | The length of the stream, in bytes |
- Returns
- Boolean value indicating whether the execution was successful (true) or not (false)
Get the CMap object currently being defined in the PostScript environment.
- Parameters
-
pse | The PostScript environment |
- Returns
- CMap object or NULL if none is being defined currently
Get the operand at the given index (zero-based) of the operand stack. The operand stack contains all results that have not been consumed by other operations yet. For example, executing "/MyFontName /CID findresource" after executing a CMap resource definition for a font named "MyFontName" will put the "MyFontName" dictionary at the top of the operand stack. This can then be obtained using PDDictionaryRef myCMapDict = pd_ps_get_operand(pse, 0); from which the actual PDCMap object is in the "#cmap#" key.
- Parameters
-
pse | The PostScript environment |
index | The index (zero-based) in the stack which should be fetched |
- Returns
- The object at the given index, or NULL if the index was beyond the size of the operand stack
Get the results of the PostScript execution(s) for the given environment.
- Parameters
-
pse | The PostScript environment |
- Returns
- A PDDictionary containing the root user dictionary
Set the explicit CMap object for the PostScript environment. This will force the system to use this CMap object, rather than creating a new one, for the first "begincmap" encountered. Subsequent (if multiple) "begincmap" executions will create additional CMaps as normal.
- Parameters
-
pse | The PostScript environment |
cmap | The CMap object |