Implementation
static List<PaperFormat> all(ReportLocalizations l10n) {
final formats = <PaperFormat>[
// Adhesive A4 sheets, common office-supply layouts.
const PaperFormat(
id: 'a4_3x8',
feed: PaperFeed.sheet,
pageWidthMm: 210,
pageHeightMm: 297,
columns: 3,
rows: 8,
cellWidthMm: 70,
cellHeightMm: 37,
marginTopMm: 0.5,
),
const PaperFormat(
id: 'a4_3x7',
feed: PaperFeed.sheet,
pageWidthMm: 210,
pageHeightMm: 297,
columns: 3,
rows: 7,
cellWidthMm: 70,
cellHeightMm: 42.4,
),
const PaperFormat(
id: 'a4_4x10',
feed: PaperFeed.sheet,
pageWidthMm: 210,
pageHeightMm: 297,
columns: 4,
rows: 10,
cellWidthMm: 48.5,
cellHeightMm: 25.4,
marginTopMm: 21.5,
marginLeftMm: 8,
),
const PaperFormat(
id: 'a4_5x13',
feed: PaperFeed.sheet,
pageWidthMm: 210,
pageHeightMm: 297,
columns: 5,
rows: 13,
cellWidthMm: 38.1,
cellHeightMm: 21.2,
marginTopMm: 10.7,
marginLeftMm: 4.75,
gapXMm: 2.5,
),
// Thermal label rolls.
const PaperFormat.roll(id: 'roll_50x30', widthMm: 50, heightMm: 30),
const PaperFormat.roll(id: 'roll_40x30', widthMm: 40, heightMm: 30),
const PaperFormat.roll(id: 'roll_58x40', widthMm: 58, heightMm: 40),
const PaperFormat.roll(id: 'roll_62x29', widthMm: 62, heightMm: 29),
// Single pages and pages split in halves or quarters.
const PaperFormat(
id: 'a4_portrait',
feed: PaperFeed.sheet,
pageWidthMm: 210,
pageHeightMm: 297,
columns: 1,
rows: 1,
cellWidthMm: 210,
cellHeightMm: 297,
),
const PaperFormat(
id: 'a4_landscape',
feed: PaperFeed.sheet,
pageWidthMm: 297,
pageHeightMm: 210,
columns: 1,
rows: 1,
cellWidthMm: 297,
cellHeightMm: 210,
),
const PaperFormat(
id: 'sign_a5',
feed: PaperFeed.sheet,
pageWidthMm: 210,
pageHeightMm: 297,
columns: 1,
rows: 2,
cellWidthMm: 210,
cellHeightMm: 148.5,
),
const PaperFormat(
id: 'sign_a6',
feed: PaperFeed.sheet,
pageWidthMm: 210,
pageHeightMm: 297,
columns: 2,
rows: 2,
cellWidthMm: 105,
cellHeightMm: 148.5,
),
];
return [
for (final format in formats)
format.copyWith(name: _defaultName(l10n, format)),
];
}