visualpdf 1.8.4 copy "visualpdf: ^1.8.4" to clipboard
visualpdf: ^1.8.4 copied to clipboard

A visual Flutter PDF report designer and runtime for JSON-driven invoices, templates, tables, barcodes, headers, footers, and printing.

example/lib/main.dart

import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:visualpdf/visualpdf.dart';

void main() {
  final template = ReportTemplate(
    name: 'Invoice example',
    elements: [
      ReportElement(
        id: 'title',
        type: ElementType.text,
        x: 42,
        y: 42,
        width: 300,
        height: 40,
        value: 'INVOICE',
        fontSize: 26,
        bold: true,
        band: 'header',
      ),
      ReportElement(
        id: 'invoice_number',
        type: ElementType.field,
        x: 380,
        y: 50,
        width: 170,
        height: 24,
        value: 'No. {{invoice.number}}',
        textAlign: 'right',
        band: 'header',
      ),
      ReportElement(
        id: 'customer',
        type: ElementType.field,
        x: 42,
        y: 130,
        width: 250,
        height: 70,
        value: '{{customer.name}}\n{{customer.city}}',
      ),
      ReportElement(
        id: 'page',
        type: ElementType.field,
        x: 420,
        y: 810,
        width: 130,
        height: 18,
        value: 'Page {{PageNumber}}/{{PageCount}}',
        textAlign: 'right',
        fontSize: 9,
        band: 'footer',
      ),
    ],
  );

  final reportData = {
    'invoice': {'number': 'INV-2026-001'},
    'customer': {'name': 'Example GmbH', 'city': 'Munich'},
  };

  runApp(
    MaterialApp(
      debugShowCheckedModeBanner: false,
      home: VisualPdfRuntime(
        initialVps: template.toVps(),
        initialJson: jsonEncode(reportData),
      ),
    ),
  );
}
1
likes
140
points
538
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A visual Flutter PDF report designer and runtime for JSON-driven invoices, templates, tables, barcodes, headers, footers, and printing.

Homepage

Topics

#pdf #reports #invoices #templates #printing

License

MIT (license)

Dependencies

barcode, file_picker, flutter, flutter_localizations, pdf, printing

More

Packages that depend on visualpdf