PdfContentWriter class
Reserializes a list of operators back into content stream bytes.
What is preserved
Literals are re-emitted from the original lexeme when there is one (numbers
with the same notation, names with the same #xx escapes, strings with the
same escapes and delimiters), and the bytes of an inline image come out
identical to the input.
What changes
The spacing between tokens is normalized: one space between operands and
one line break after every operator. So the output is not byte-for-byte
equal to the input for an arbitrary stream — the guarantee that holds is
equivalence: reparsing the output produces the same list of operators.
Comments only survive if the parser was created with
keepComments: true.
Constructors
- PdfContentWriter({int lineBreak = 0x0A})
-
Creates a writer.
const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
serialize(
List< PdfContentOperator> operators) → Uint8List -
Serializes
operatorsinto bytes. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
escapeName(
String name) → String -
Applies the
#xxescapes required in a PDF name. -
formatNumber(
double value) → String -
Formats a number the PDF way: no exponent, no unnecessary trailing
zeros, and no
.0for integers. -
write(
List< PdfContentOperator> operators) → Uint8List -
Serializes
operatorsinto bytes.