The PDF implementation in Pajdeg makes use of states and operators to set up how the scanner should interpret the source data.
States in Pajdeg are constant definitions for given states in the input file, and operators are chained together actions to take based on some given input to a state.
There are two main root states in the implementation: pdfRoot, for parsing PDF content as normal, and xrefSeeker, for locating the starting byte offset of the primary XREF table. There are a few additional root states, stringStream (currently unused) and arbStream (used to parse object streams).
These states are made up of operators which chain states together to form the complete specification implementation.
- See also
- STATE_GRP
-
OPERATOR_GRP
#define PDIdentifies |
( |
|
key, |
|
|
|
pdtype |
|
) |
| ((PDID)key == &pdtype) |
Convenience macro for comparing a given value to one of the PD_ entries.
void pd_pdf_conversion_discard |
( |
| ) |
|
Release the PDF conversion table.
void pd_pdf_conversion_use |
( |
| ) |
|
Retain the PDF conversion table.
void pd_pdf_implementation_discard |
( |
| ) |
|
Release (destructing, if no other retains remain) the PDF implementation.
void pd_pdf_implementation_use |
( |
| ) |
|
Retain (constructing, if no previous retains were made) the PDF implementation.
void* PDInstanceCreateFromComplex |
( |
pd_stack * |
complex | ) |
|
Convert stack representation of complex object into an appropriate object.
- Note
- Returned strings are returned as PDString instances.
-
Returned entry must be PDRelease()'d
- Parameters
-
complex | Stack representation |
- Returns
- An appropriate object. Use PDResolve() to determine its type.
Determine object type from identifier.
- Parameters
-
identifier | One of the PD_ identifiers. |
char* PDStringFromComplex |
( |
pd_stack * |
complex | ) |
|
Convert stack representation of complex object into PDF string.
- Warning
- Destroys target stack unless preserve flag is set.
- Todo:
- Change name to reflect that returned value is allocated and must be freed.
- See also
- pd_stack
-
pd_stack_set_global_preserve_flag
Arbitrary object stream (e.g. object stream post-header) state.
A generic null deallocator.
String stream state. Instead of attempting to generate complex objects using definitions, this state always returns the next symbol (whitespace separated) as a string.
The PDF array state, useful for iterating over stuff. The root XREF seeking state.