PaperFormat class

Physical layout of the media a template prints on.

Every measure is in millimetres. A sheet holds columns x rows cells of cellWidthMm x cellHeightMm; a roll holds a single cell per page. Paper formats are kept by the PrintStore and can be created, changed and deleted by the users allowed to manage the print library.

Constructors

PaperFormat({required String id, String name = '', required PaperFeed feed, required double pageWidthMm, required double pageHeightMm, required int columns, required int rows, required double cellWidthMm, required double cellHeightMm, double marginTopMm = 0, double marginLeftMm = 0, double gapXMm = 0, double gapYMm = 0})
const
PaperFormat.roll({required String id, String name = '', required double widthMm, required double heightMm})
const
PaperFormat.single({required double widthMm, required double heightMm})
A single page as big as widthMm x heightMm, used when a template points to a paper format that no longer exists.
const

Properties

cellHeightMm → double
final
cellsPerPage → int
no setter
cellWidthMm → double
final
columns → int
final
feed → PaperFeed
final
gapXMm → double
final
gapYMm → double
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
final
isMultiCellSheet → bool
no setter
marginLeftMm → double
final
marginTopMm → double
final
name → String
final
pageHeightMm → double
final
pageWidthMm → double
final
rows → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
validationError → PaperFormatError?
Why the measures cannot print, or null when they are valid.
no setter

Methods

cellOrigin(int index) → ({double leftMm, double topMm})
Top-left corner of the cell at index (0-based, row by row).
copyWith({String? id, String? name}) → PaperFormat
describe(ReportLocalizations l10n) → String
Description built from the measures, e.g. "A4 sheet · 24 labels 70×37 mm".
displayName(ReportLocalizations l10n) → String
Name chosen by the shop, or a description built from the measures.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sheetSkips(int labels, List<int> requested) → List<int>
Positions skipped on each sheet needed to print labels labels.
toItem() → PrintStoreItem
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

formatMm(double value) → String
tryFromItem(PrintStoreItem item) → PaperFormat?
Returns null when the stored data is incomplete or out of range.