PdfObjectConverter class
Converts the parser's tokenized model (PdfDictToken, PdfArrayToken,
PdfNameToken, PdfStringToken, PdfRefToken, numbers, booleans and
null) into the writing model (PdfDataType).
This is the single core of that conversion. Whoever needs a different rule for references injects a PdfReferenceResolver instead of writing another converter: reading a loaded document uses PdfReferencePolicy.preserve and importing between documents uses PdfReferencePolicy.remap.
Values the parser cannot represent become null, not an exception.
Constructors
- PdfObjectConverter({PdfReferenceResolver referencePolicy = PdfReferencePolicy.preserve, PdfArrayGapPolicy arrayGapPolicy = PdfArrayGapPolicy.drop})
-
Creates a converter with the wanted reference and array-gap policies.
const
Properties
- arrayGapPolicy → PdfArrayGapPolicy
-
How a dropped array item is handled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- referencePolicy → PdfReferenceResolver
-
How an indirect reference is translated.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
convert(
dynamic value) → PdfDataType? - Converts any value from the tokenized model.
-
convertArray(
PdfArrayToken array, {PdfArrayGapPolicy? gapPolicy}) → PdfArray< PdfDataType> - Converts a direct array.
-
convertDict(
PdfDictToken dict, {Set< String> ignoreKeys = const <String>{}}) → PdfDict<PdfDataType> -
Converts a direct dictionary, ignoring the keys in
ignoreKeys. -
mergeDictInto(
PdfDict< PdfDataType> target, PdfDictToken source, {Set<String> ignoreKeys = const <String>{}}) → void -
Merges the keys of
sourceintotarget, ignoringignoreKeys. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withReferencePolicy(
PdfReferenceResolver policy) → PdfObjectConverter - Returns a copy of this converter with another reference policy.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- preserving → const PdfObjectConverter
- Converter that preserves the source object numbers.