visualpdf library
Visual PDF report templates, rendering, runtime preview, and editor UI.
Import this library to create JSON-driven PDF reports, serialize templates
as .vps files, embed the print-only runtime, or launch the visual editor.
Classes
- AggregateRule
- Describes one calculated line beneath a table.
- Designer
- Full visual report-template editor.
- ReportColumn
- Describes a column in a JSON-backed table element.
- ReportElement
- A positioned, printable element in a ReportTemplate.
- ReportFont
- A TTF or OTF font embedded directly in a VPS template.
- ReportTemplate
- A configurable ISO paper layout containing positioned report elements.
- SummaryLine
- A calculated table-summary result returned by calculateSummary.
- TaxRule
- Defines an optional tax line for a table summary.
- VisualPdfApp
- Root application that can launch VisualPDF in either supported mode.
- VisualPdfRuntime
- Read-only report runner: it combines a VPS template with JSON data and exposes only preview, PDF export and printing.
Enums
- AggregateFunction
- Aggregate operations available for table data.
- ChartType
- ColumnFormat
- Formatting applied to table cells and aggregate results.
- ElementPageVisibility
- Restricts an element to a specific physical report page.
- ElementType
- Element kinds supported by the visual editor and PDF renderer.
- ReportOrientation
- Orientation of the physical report page.
- ReportPaperSize
- ISO 216 paper sizes supported by VisualPDF.
- VisualPdfMode
- Selects the complete editor or protected report runtime.
Extensions
Functions
-
barcodeForElement(
ReportElement element) → Barcode -
Creates the barcode encoder configured by
element. -
calculateAggregate(
AggregateRule rule, List rows) → double -
Applies
ruletorowsand returns its numeric result. -
calculateReportPageCount(
ReportTemplate template, Map< String, dynamic> data) → int -
Returns the number of physical pages required for
templateanddata. -
calculateSummary(
ReportElement table, Map< String, dynamic> data, {String locale = 'de-DE'}) → List<SummaryLine> -
Calculates aggregates, subtotal, discount, taxes, and total for
table. -
chartData(
ReportElement chart, Map< String, dynamic> data) → List<(String, double)> - Returns chart labels and numeric values resolved from its JSON array.
-
chartSvg(
ReportElement chart, Map< String, dynamic> data) → String - Generates a self-contained SVG, which remains vector graphics in the PDF.
-
discoverDataPaths(
Map< String, dynamic> data) → List<String> -
Discovers scalar and array paths available in
data. -
evaluateFormula(
String source, dynamic context, {Map< String, dynamic> variables = const {}}) → dynamic -
formatCell(
dynamic value, ColumnFormat format, {String locale = 'de-DE', String currency = 'EUR'}) → String -
Formats one table or aggregate value using
format. -
groupRows(
List rows, String field) → Map< String, List> - Stable, insertion-ordered grouping of table rows.
-
isElementVisible(
ReportElement element, Map< String, dynamic> data, {int pageNumber = 1, int pageCount = 1}) → bool - Evaluates an element's page and data visibility rules.
-
renderPdf(
ReportTemplate template, Map< String, dynamic> data) → Future<Uint8List> -
Renders
templatewithdataand returns a complete PDF byte buffer. -
resolveData(
String source, Map< String, dynamic> data, {int pageNumber = 1, int pageCount = 1, DateTime? now, String locale = 'de-DE', Map<String, dynamic> variables = const {}}) → String -
Replaces JSON and system-field tokens in
source. -
resolvePath(
String path, dynamic data) → dynamic -
Resolves a dot-separated
pathin a nested JSON-compatible object. -
resolveValueExpression(
String expression, dynamic data) → dynamic - Resolves either a plain JSON path or a formula against one data row.
-
rowAmount(
dynamic row, String expression) → double -
Resolves a numeric field or multiplication expression against
row. -
validateFormula(
String source) → String?
Exceptions / Errors
- FormulaException
- Small, dependency-free expression engine used by VisualPDF templates.