DavBfr/dart_pdf
59.6
Adequate · 19 September 2026
97.6k
lines of production code
Dart
primary language
1
measurement over time
What this system is
This system is a Flutter-based toolkit for generating and printing PDF documents across mobile, desktop, and web platforms. It provides a library for creating PDFs programmatically using a widget-based API, supporting complex layouts, charts, and international text. The system also includes a printing plugin that interfaces with native OS services to handle document previewing, sharing, and direct printing on Android, iOS, Linux, macOS, and Windows.
How it got here
2018–2019 — PDF library restructuring and Android support
10 changes.
The pdf library was reorganized with a cleaner public API and expanded features like encryption and PDF/A-3b compliance, supported by a comprehensive new test suite. Concurrently, the printing plugin received its initial Android native implementation and underwent internal architectural refactoring to improve maintainability and caching.
2020 — Cross-platform demo expansion and PDF library refactoring
11 changes.
This period focused on expanding the project's cross-platform support by adding native demo applications for iOS, macOS, and Windows, alongside modernizing the web demo. Concurrently, the core PDF library underwent significant structural refactoring, introducing new widget layouts, charting capabilities, and improved SVG rendering, while enhancing performance through background isolates and better color management.
2021–2026 — Linux/Windows support and PDF engine modernization
13 changes.
This period focused on expanding platform coverage by adding native Linux and Windows support to both the printing plugin and demo application, while simultaneously modernizing the core PDF engine. The PDF library underwent significant internal restructuring, introducing a new widget wrapper for embedding Flutter widgets, improving bidirectional text rendering, and consolidating internal APIs for better stability and serialization control.
Features
Add Linux desktop support to the demo application
The demo application now includes a complete Linux build configuration, enabling users to run and test the printing functionality on desktop Linux environments. This change introduces the necessary CMake build files, GTK-based native application entry points, and Flutter plugin registrants to integrate the printing, open file, and URL launcher plugins on the Linux platform.
demo/linux · high confidence
Add Linux platform support to the printing plugin
This change introduces a new Linux implementation for the printing plugin, enabling Flutter applications on Linux to access system printers, generate print jobs, and rasterize PDFs. The implementation relies on the GTK Unix Print library for native print dialog and job management, and integrates the Pdfium library (version 5200) for PDF rendering. It includes the necessary CMake build configuration, plugin registration, and method channel handling to expose printing capabilities to the Dart layer.
printing/linux · high confidence
Add PDF generation example
A new example file (pdf/example/main.dart) demonstrates how to generate a PDF document using the library's widget system, including creating a page with centered text and saving the output to a file.
pdf/example · high confidence
Add Windows desktop demo application
The demo now includes a complete Windows desktop application, providing the necessary CMake build configuration, Visual Studio project files, and native C++ runner code to build and run the Flutter PDF demo on Windows. This addition enables users to test the printing functionality on the Windows platform alongside existing mobile and desktop targets.
demo/windows · high confidence
Add iOS demo application for PDF printing
The iOS demo project has been added to the repository, providing a native Xcode workspace and project structure for testing PDF printing capabilities. This includes the standard iOS application entry point, storyboards for the launch and main screens, asset catalogs for app icons and launch images, and the necessary configuration files (Info.plist, xcconfig) to build and run the Flutter-based demo on iOS devices and simulators.
demo/android, demo/ios · high confidence
Add new Printing example application
The printing/example directory now includes a complete, runnable Flutter application (main.dart) and a .gitignore file. The example demonstrates generating a PDF document using the pdf package and displaying it via PdfPreview, serving as a reference implementation for users.
printing/example · high confidence
Initial Android native implementation for PDF printing and conversion
This change introduces the Android native side of the Flutter Printing plugin, enabling users to print PDF documents, share them via system intents, and convert HTML to PDF on Android devices. The implementation includes a new \PrintingPlugin\ using the modern Flutter embedding API, a \PrintingHandler\ to manage method channel calls (such as \printPdf\, \sharePdf\, and \convertHtml\), and a \PrintingJob\ class that leverages the Android Print Framework for layout and rendering. It also adds a \PrintFileProvider\ and associated manifest entries to securely share cached PDF files, along with a \PdfConvert\ utility for handling print job lifecycle events.
printing/android · high confidence
Initial Windows printing support with modern dialog and PDFium integration
This change introduces the first native Windows implementation for the printing plugin, enabling users to print PDFs directly from Flutter applications on Windows. The implementation integrates the PDFium library (version 5200) for PDF rendering and provides a CMake-based build system that automatically downloads the required native dependencies. Users benefit from support for the modern Windows print dialog (PrintDlgEx) as an option, the ability to utilize the printer's native settings, and proper handling of print job lifecycles and memory management to prevent leaks.
printing/windows · high confidence
Introduce PDF widget wrapper module
A new entry point file is added to the library that re-exports the internal widget wrapper implementation, making the PDF widget wrapper functionality available to consumers of the package.
_widget\wrapper/lib · high confidence
Introduce new charting widgets for PDF documents
The PDF library now includes a new charting subsystem under \pdf/lib/src/widgets/chart\, enabling users to render data visualizations directly in generated PDFs. This addition introduces a \Chart\ widget that manages layout and coordinate grids, supporting both Cartesian (\CartesianGrid\) and radial (\RadialGrid\) layouts. Specific chart types are provided via dedicated dataset widgets: \BarDataSet\ for bar charts, \LineDataSet\ for line charts (with support for curved lines and filled surfaces), \PointDataSet\ for scatter plots, and \PieDataSet\ for pie charts. The system also includes a \ChartLegend\ widget for automatic legend generation and \GridAxis\ classes for customizable axis labels and ticks.
pdf/lib/src/widgets/chart · high confidence
New Flutter PDF demo application with dark mode support
The demo application has been restructured into a new Flutter app located in demo/lib, featuring a tabbed interface to browse various PDF generation examples (Resume, Document, Invoice, Report, Server, Calendar, Certificate). The app now supports dark mode via ThemeData configuration and includes user-facing features such as saving PDFs to local storage, sharing documents, and prompting for user input (e.g., name) for dynamic content generation. It also provides a floating action button to view the source code of the currently selected example on GitHub.
demo/lib · high confidence
New PDF generation examples added to the demo
The demo application now includes several new example files for generating PDFs, specifically: a Calendar view, a Certificate of Achievement, a generic Document with a table of contents, an Invoice with line items and totals, a Budget Report with bar and line charts, a Resume with a partitioned layout and QR code, and a Server pricing page that fetches live data from the VPSDime API.
demo/lib/examples · high confidence
New WidgetWrapper class for embedding Flutter widgets in PDFs
A new \WidgetWrapper\ class has been added to the library, allowing users to convert Flutter widgets into image providers that can be embedded directly into PDF documents. This feature supports wrapping widgets via a \GlobalKey\ or directly from a widget instance, handling the necessary rendering pipeline to capture the widget's visual state as an image suitable for PDF pages.
_widget\wrapper/lib/src · high confidence
New macOS demo project scaffolding
A complete macOS demo application (Pdf Printing Demo) has been added to the repository, providing a native Xcode project structure with Swift source files, entitlements for sandboxing and printing, and configuration files for build settings.
demo/macos · high confidence
PDF widget library restructured into src/widgets with new layout and annotation components
The PDF generation library's widget layer has been reorganized into the \pdf/lib/src/widgets\ directory, introducing a comprehensive set of layout and content widgets. This change adds support for flexible box layouts via \Flex\, \Row\, and \Column\, alongside structural containers like \Container\, \Padding\, and \LimitedBox\. New annotation capabilities include \Anchor\, \Link\, and visual markers like \Square\ and \Circle\. The update also introduces specialized widgets for \BarcodeWidget\, \ClipRect\, \ClipRRect\, and \ClipOval\, as well as content helpers like \Header\ and \TableOfContent\. The \Document\ class now exposes an asynchronous \save\ method and supports metadata injection, while border styling is handled by a new \BorderStyle\ class supporting solid, dashed, and dotted patterns.
pdf/lib/src/widgets · high confidence
PdfPreview widget refactored with new theming, actions, and custom rendering capabilities
The PdfPreview widget has been significantly updated to offer greater customization and stability. Users can now style the action bar using the new PdfActionBarTheme, which allows control over background color, icon color, height, text style, elevation, spacing, and alignment (including crossAxisAlignment). The widget supports generic custom actions via PdfPreviewAction, enabling developers to add specific behaviors like printing, sharing (with optional subject, body, and email pre-filling), or custom logic. Additionally, a new builder constructor (PdfPreview.builder) and pagesBuilder callback allow for fully custom page rendering layouts, while features like shrinkWrap, custom scroll physics, scroll-to-page, and DPI control provide finer control over the preview's appearance and performance.
printing/lib/src/preview · high confidence
Security
Migrate web printing to modern JavaScript interop and update PDF.js
The web printing implementation has been updated to use the modern \dart:js\_interop\ and \package:web\ APIs, replacing older JavaScript binding mechanisms. Additionally, the embedded PDF.js library has been upgraded to version 6.2.108 to address security vulnerability [CVE redacted] and to support ES module loading. These changes ensure better compatibility with current web standards and improve security for users printing PDFs in browsers.
printing/lib · high confidence
Architecture
Library restructured into modular source files with new asset and caching utilities
The printing library source code has been reorganized into distinct, modular files (such as asset\_utils.dart, cache.dart, callback.dart, interface.dart, and method\_channel.dart) to improve maintainability and separation of concerns. This change introduces new utility functions for loading images and fonts from Flutter asset bundles and networks, alongside a dedicated PdfBaseCache system for managing downloaded resources. The public API surface remains consistent, but the internal implementation is now split across these specific components, including a new platform interface and method channel implementation.
printing/lib/src · high confidence
Behavioural changes
Consolidated internal API exports via priv.dart
A new priv.dart file has been introduced to centralize and re-export a broad set of internal PDF format and object model components (such as array, dict, stream, catalog, and page\_list). This change reorganizes how internal data types and private APIs are exposed within the library, likely simplifying imports for internal modules and improving the structure of the codebase's private surface area.
pdf/lib/src · medium confidence
Improved Arabic and bidirectional text rendering
The PDF library now applies the bidirectional algorithm (via the bidi package) to correctly render mixed-direction text, and includes a new arabic.dart module with substitution maps to handle Arabic shaping (isolated, final, initial, medial forms) and diacritics. This ensures that Arabic characters and mixed RTL/LTR content appear in the correct visual order and with proper glyph connections in the generated PDF.
pdf/lib/src/pdf/font · high confidence
Improved PDF generation performance on web and VM platforms
PDF generation now runs in a background isolate on VM platforms (non-test environments) and includes an event-loop balancer to prevent UI freezes on web platforms. This change ensures that long-running PDF creation tasks no longer block the main thread, resulting in a more responsive application during document generation.
pdf/lib/src/pdf/io · high confidence
New internal font loading and manifest infrastructure
The library now includes a new \DownloadableFont\ class and an \AssetManifest\ mixin to handle font resolution. This infrastructure allows the system to first check if a font is available as a local asset (via the new manifest) and, if not, download it from a URL with caching support, falling back to Helvetica on failure. This replaces previous ad-hoc font loading logic with a unified, cache-aware mechanism for both bundled and remote fonts.
printing/lib/src/fonts · high confidence
PDF library restructured into src/pdf with new color and graphic state APIs
The PDF generation library has been reorganized, moving core implementation files into the pdf/lib/src/pdf directory. This change introduces a new PdfColor class with support for hex parsing, RYB conversion, and immutable color manipulation methods (withAlpha, withRed, etc.), alongside a PdfColors utility providing Material Design color palettes. Graphic rendering capabilities are enhanced with a new PdfGraphicState class that manages opacity, blend modes, and soft masks, integrated into the PdfGraphics canvas. The document structure is updated to use PdfSettings for configuration, and page formatting now includes an A6 preset and a logical pixel constant. Additionally, JPEG metadata extraction (EXIF) has been improved to handle orientation and Adobe APP14 markers correctly.
pdf/lib/src/pdf · high confidence
PDF library restructured with new public API entry points
The pdf library has been reorganized to provide cleaner public APIs through new top-level entry files. The main \pdf.dart\ file now exports core document, font, and PDF object classes, while a new \widgets.dart\ file consolidates all UI components including charts, forms, and layout widgets. This change also introduces a new \PdfException\ base class for error handling and adds support for PDF/A-3b compliance, document signatures, and encryption features.
pdf/lib · high confidence
Reorganized PDF format layer with new data types and settings
The PDF generation internals in the format layer have been restructured to improve code clarity and reduce web freezes. This change introduces a new set of dedicated classes for PDF data types (such as PdfArray, PdfDict, PdfBool, PdfNum, PdfString, PdfName, PdfNull, and PdfIndirect) that handle their own serialization logic. It also centralizes generation configuration into a new PdfSettings class, which includes options for compression, encryption, verbose output, PDF version selection, and a new simple TrueType font mode. Additionally, the cross-reference table output has been improved to support both legacy and compressed formats based on the selected PDF version.
pdf/lib/src/pdf/format · high confidence
SVG rendering engine refactored into modular components
The SVG rendering logic has been restructured from a monolithic implementation into a set of specialized, modular classes (such as SvgBrush, SvgColor, SvgPath, SvgText, and SvgGroup) within the pdf library. This refactoring improves the maintainability and correctness of SVG parsing and drawing, enabling more accurate support for complex SVG features like gradients, masks, and text styling in generated PDFs.
pdf/lib/src/svg · high confidence
Updated web demo to use Flutter 3.22 initialization and modern PWA assets
The web demo now uses the Flutter 3.22 app initialization pattern, replacing the previous script with the \\_flutter.loader.load\ API for engine initialization and app running. Additionally, the demo includes a new \manifest.json\ file to support Progressive Web App (PWA) features, including specific icons and theme colors, and an \index.html\ with a loading progress indicator that updates as the app initializes.
demo/web · high confidence
Fixes
Fix iOS printing crashes and App Store distribution failures
This update resolves critical stability and distribution issues in the iOS printing plugin. It fixes a use-after-free race condition in PDF document handling that caused crashes during page counting and drawing by introducing thread-safe locking. It also corrects a bug where the \pickPrinter\ method crashed if the selected printer had a nil URL. Additionally, the plugin now returns the layout PDF document via the standard method-channel reply instead of using \dlsym\ FFI, which prevents silent failures in App Store distribution builds where exported symbols are stripped. The migration to Swift Package Manager and the addition of the \CustomPrintPaper\ class support these structural improvements.
printing/ios · high confidence
Fix macOS print deadlock and support multiple windows
The macOS printing plugin now prevents deadlocks that occurred with newer Flutter versions by switching the layout PDF document retrieval from a fragile dlsym-based FFI callback to a standard method-channel reply. Additionally, print jobs are now shared across plugin instances using a thread-safe map, enabling correct behavior when multiple Flutter windows are open simultaneously.
printing/macos · high confidence
Test coverage
Added comprehensive test suite for PDF generation features; Added test for PDF document generation in the demo app; Added test utilities for font generation, README extraction, and social preview assets; Initial test suite for printing core functionality.
Dependencies
Update project dependencies and build configurations
This change updates the dependency manifests and build configurations for the demo, pdf, printing, widget\_wrapper, and test packages. Key updates include raising the minimum Dart SDK to 3.12.0, updating the \pdf\ package to version 3.13.1, and upgrading \printing\ to 5.15.1. The \pdf\ package now depends on \barcode\ \>=2.2.3, \xml\ \>=7.0.1, and \vector\_math\ ^2.2.0. The \printing\ plugin now depends on \web\ ^1.0.0 and \pdf\_widget\_wrapper\ \>=1.0.4. Android build files have been updated to use Gradle 7.1.2/7.3.0 and Java 8, while iOS/macOS configurations now include Swift Package Manager manifests targeting iOS 13.0 and macOS 10.15.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 60.
Lenses
- Code Health 88
- Architecture 98
- Maturity 49
- Readiness 50
- Security 80
- Domain Modelling 100
Changes since last survey
- 300 commits — 208 feature/other, 92 fixes
By area
- pdf/lib — 83 commits
- printing/lib — 43 commits
- pdf/CHANGELOG.md — 37 commits
- printing/CHANGELOG.md — 37 commits
- pdf/pubspec.yaml — 9 commits
- printing/ios — 9 commits
- .github/workflows — 8 commits
- printing/pubspec.yaml — 8 commits
- printing/windows — 8 commits
- (repo) — 7 commits
- pdf/test — 6 commits
- (root) — 5 commits
- demo/lib — 4 commits
- printing/linux — 4 commits
- printing/macos — 4 commits
- widget_wrapper/lib — 4 commits
- pdf/README.md — 3 commits
- widget_wrapper/CHANGELOG.md — 3 commits
- demo/ios — 2 commits
- demo/web — 2 commits
Notable commits
- fix: Add TextAlign.start and TextAlign.end and fix Line.realign accordingly change widgets geometry to directional geometry
- fix: Add more Wasm fixes
- fix: CMP0135 policy issue fixed by adding DOWNLOAD_EXTRACT_TIMESTAMP parameter as true
- fix: Fix Arabic fonts missing isolated form ( mostly Arabic Google fonts ) (#1451)
- fix: Fix CMYK
- fix: Fix Deprecation warning message
- fix: Fix English
- fix: Fix Flutter SDK Minimum version
- fix: Fix MultiPage.maxPages not checked with release builds
- fix: Fix PdfColorCmyk.fromRgb
- fix: Fix PdfImage constructor without alpha channel
- fix: Fix RangeError in PdfPreviewRaster._raster
- fix: Fix TextStyle merge decoration
- fix: Fix Type1 font widths
- fix: Fix Windows PDFium lifecycle
- fix: Fix Windows print job hanging forever on a malformed PDF
- fix: Fix changelogs
- fix: Fix cmake build on Linux and Windows
- fix: Fix cursors for web
- fix: Fix dart style
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
DavBfr/dart_pdf was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 1ce3ee24331df4345952d4104cde1852f12a7090 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.