Published 2026-06-04
Abstract command tokens used by pkg_pdflib.

These have no real binding to the pdflib binaries, but provide enough functionality to build json that can be consumed by the pkg_pdflib generator classes.
Can be used in invironments where the pdflib binaries are not available, like a web-application.
To regenerate the json classes use dart run build_runner build.
withAnnotations attribute on Mergepdf token to control whether text annotations are merged from source PDFs (defaults to false).lib/src/generator/constants/constants.dart with shared kUnset sentinel (const Object kUnset = Object()).copyWith() methods now reference the shared kUnset sentinel (was a per-file private _unset).type field is now set via the constructor initializer list instead of being a named parameter; this prevents type from being passed incorrectly by callers.@JsonKey(includeFromJson: false, includeToJson: true) to the type field of all tokens so that type is always written to JSON but never read back (prevents JSON pollution from overriding the fixed type).TokenValidation.validate() now detects cycles in the token graph using a visited-set, preventing a StackOverflowError when a token appears more than once during recursive traversal.dumpVariables attribute on most tokens.copyWith methods to prevent accidental mutation, and to allow explicit setting of null for fields.flowtype attribute (xhtml, text) to Templatetext and Textframe.Templatetext, Textflow and Textframe default to flowtype: 'xhtml'.Templatetext.copyWith had missing useBlock option.filenamecomposer field on Document token.metadata field on Document token.page to templatepdf.TokenFactory class.kPdflibCompatibilityVersion constant.Mergepdf.EquatableMixin from LoadFont that prevented code generation.charref=true from `LoadFont'.finals due to new linter rules.IToken.children is now a List<IToken> not List<dynamic>.orientation to Mergepdf that will rotate all pages to the specified orientation if needed.TokenValidation mixin from pkg_pdflib.