Published 2026-06-01
Complete port of the java libIMPOSITION library.

Orienting the original bleed values array:
[
index 0: TOP (T),
index 1: RIGHT (R),
index 2: BOTTOM (B) and
index 3: LEFT (L).
]
Results in:
| Orientate | Original | Oriented | Bleed values |
|---|---|---|---|
| NORTH: | [T, R, B, L] | [T, R, B, L] | (no change) |
| EAST: | [T, R, B, L] | [R, B, L, T] | (first element to tail) |
| SOUTH: | [T, R, B, L] | [B, L, T, R] | (first 2 elements to tail) |
| WEST: | [T, R, B, L] | [L, T, R, B] | (first 3 elements to tail) |
Coordinate system
Because of the incompatibility of the coordinate systems used internally and that of external softwares, this library uses a coordinate system that has its origin at the bottom left corner.
A bottom-left origin is te most natural choise for describing imposition layouts, because it conforms to the current print industry standard.
The SVG coordinate system defaults to a top left origin, And the default, and preferable, origin of PDF files is bottom left 1.
This means that (Imposition) output generators should take care of proper conversion to the target coordinate system.
1 Although it is possible to create PDF files with a topdown coordinate system , this can lead to various problems. Querying block coordinates with PDFlib for instance will allways return values relative to the original bottom-left coordinate system.
"Note that the topdown option is not taken into account when querying Block coordinates." (PDFlib documentation)
pkg_colors dependency.SvgGenerator rendering flags (showPageBoxes, showDimensions, showDebugInfo, withInlineStyles) are now immutable constructor parameters. Replace SvgGenerator()..showPageBoxes = true with SvgGenerator(showPageBoxes: true).DartGenerator: guard against empty horizontalInterspace / verticalInterspace arrays to prevent index-out-of-range.PdfGenerator: guard labelAnchors.isNotEmpty before accessing labelAnchors[0] in slug-line label positioning.ImpositionGeneratorBuilder.fromImpositionParameters: was incorrectly assigning getVerticalLines() to horizontalLines; now correctly calls getHorizontalLines().FitBoxMatrix._populateHorizontalFlow / _populateVerticalFlow: both were checking getColumnCount() <= 0 twice; now correctly check getRowCount() <= 0 || getColumnCount() <= 0.FitBoxMatrix._populateSlugLines: null-safe handling of _calculateSlugRect result — skips with continue instead of force-unwrapping !.ImpositionParameters.setSlugLinesLocations: clears and repopulates the _slugLineLocations cache on every call.ArrayMixin.completeArray: returns a defensive copy when source length ≥ target length.FitBoxMatrix column/row position helpers (isFirstColumnOnPrintedPage etc.): replaced full-list-scan with direct index comparison (correctness & performance).FitOrderComparator, SvgGenerator (extended), ArrayMixin (extended), FitBox (extended), FitBoxMatrix (extended), FitPdfOptions (extended), ImpositionGeneratorBuilder, ImpositionParameters (extended), Imposition, and Line2D.SvgGenerator: separate CSS rules for .fitbox-page-number and .fitbox-orientate-pointer; added stroke: none and text-anchor: middle to the stylesheet block.inline/ and no-inline/ subdirectories under a dedicated _kTmpDir.mustConvert from ParameterKey enum (was not used anywhere).ImpositionParameters to shift the content on the page.Orientate.next() to rotate the orientation to the next value (north becomes east).pkg_imposition_enums).get_it dependency.Imposition string from pdf metadata with pkg_pdfio before trying pkg_pdflib.copy_with_extension_gen dependency.toString methods).collection dependency.quiver dependency.pkg_imposition_enums.dart when using the enums only (without dependencies on pdflib).flutter_test to pure-dart test.test with flutter because of dev dependencies.kPdflibCompatibilityVersion constant.OutputDevice.grootformaat.ImpositionParameters.fromFile to read param from a pdf template.print statements for logging.finals due to new linter rules.vo cascade operator test to imposition_parameters_test.ImpositionParameters.README.md.java to dart by @ruud.