wapform_report library
Grouped, paginated reports (WapReport) and the report page (WapPage)
that previews and prints them (WML <report>, <group>, <page>).
Classes
- WapGroupRow
- State of one group level of a WapReport.
- WapLine
- One output line of a WapReport.
- WapPage
- WapReport
-
A grouped, paginated report (WML
<report>with<group>and<page>). - WapStorage
- Run-time settings and counters of a WapReport.
Constants
- kMaxGroups → const int
- Maximum number of group levels in a WapReport.
- kRulerChars → const int
- The paper content width (px) for the on-screen preview.
- kRulerCharWidthRatio → const double
- The ratio of digit-character width to font size.
Functions
-
customPaperSizeInches(
String paper) → (double, double)? - @@@ 2026-08-10 added: custom paper size, format "WIDTHxHEIGHT" (inches), e.g. the 8.5x5.5 pre-printed continuous-form paper common in Taiwan. Shares the same detection logic as named sizes (letter/A4...) -- all three call sites (screen width, CSS @page, PdfPageFormat) call this, so they never disagree. Returns null when it isn't a custom format, leaving normalizePaper to handle the named-size path.
-
isLandscape(
String orient) → bool - Whether this is landscape. Accepts L / landscape / 橫 / 水平 / 1 (case-insensitive).
-
normalizePaper(
String paper) → String - Normalizes the paper name, returning the string used for CSS @page size (A4 / letter / B5 …). Returns A4 for an empty or unrecognized value, consistent with upstream WapPage's default.
-
pageSizeOf(
String paper, String orient) → String - Builds the value for CSS @page's size, e.g. "letter landscape". @@@ 2026-08-10 fix: a custom size (e.g. "8.5x5.5") now uses its inch value directly as the CSS size, instead of always falling back to A4.
-
paperMm(
String paper, String orient) → double - Paper width (mm), taking the short or long edge depending on orientation. Shared by paperWidthPx/printChromeResetCss.
-
paperWidthPx(
String paper, String orient) → double -
Printable width in pixels of
paperin orientationorient. -
printChromeResetCss(
String pageSize, String paper, String orient) → String - @@@ 2026-08-21 The print-only "strip screen decoration + scale font to match the ruler line" stylesheet.
-
wapFontFaceCss(
String fontAsset) → Future< String> -
CSS
@font-facerule embeddingfontAsset, cached per asset. -
wapPdfPageFormat(
String paper, String orient) → PdfPageFormat - PdfPageFormat reuses the same normalizePaper/isLandscape detection as the on-screen/HTML print path, so all three (screen width, @page size, PdfPageFormat) never disagree. @@@ 2026-08-10 fix: a custom size (e.g. "8.5x5.5") now builds the PdfPageFormat directly from its inch value.