Skip to content
pubscout

flutter_html_to_pdf_plus

0.4.0, released 11 months ago by originoss.org

Flutter plugin for generating PDF documents from HTML code templates.

$ flutter pub add flutter_html_to_pdf_plus
Source repository

What it does

Generates PDF documents from raw HTML content, HTML files, or HTML file paths. Supports custom paper sizes, orientations, margins, and RTL text direction.

AI-written summary of version 0.4.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to export HTML content or web pages into PDF format inside a Flutter app
  • You need standard or custom-sized PDF documents generated from templates

Skip it when

  • You need complex fully-custom programmatic PDF generation without HTML templates

Strengths

  • Supports all standard paper sizes (A0-A10) and custom dimensions
  • Supports Right-to-Left (RTL) text direction for languages like Arabic and Hebrew
  • Handles local and web images within HTML templates

Weaknesses

  • Limited platform support compared to pure Dart PDF libraries
  • Large amounts of images in documents can significantly affect the final file size

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
1

Not documented

final generatedPdfFile = await FlutterHtmlToPdf.convertFromHtmlContent(
  content: htmlContent, 
  configuration: PrintPdfConfiguration(
    targetDirectory: targetDirectory, 
    targetName: targetName,
    margins: PdfPageMargin(top: 50, bottom: 50, left: 50, right: 50),
    printOrientation: PrintOrientation.Landscape,
    printSize: PrintSize.A4
  ),
);

Alternatives

Packages that do the same job and could replace flutter_html_to_pdf_plus.

Works with

Packages commonly used together with flutter_html_to_pdf_plus: ones it builds on, ones built on it, and its own family.