advanced_html_to_pdf 0.0.2 copy "advanced_html_to_pdf: ^0.0.2" to clipboard
advanced_html_to_pdf: ^0.0.2 copied to clipboard

A Flutter package to easily convert HTML content into high-quality PDF documents.

Advanced HTML to PDF - Package Developed By 1 More Code.

pub package Build Status Build Status

Easily convert HTML content into high-quality PDF documents in Flutter.


📝 About #

Advanced HTML to PDF is a simple yet powerful Flutter package that lets you convert HTML content into professional PDF files.
It works across Android, iOS, Linux, macOS, Windows and supports custom filenames, directories, and paper formats.


✨ Features #

  • Convert raw HTML into a PDF document
  • Fully customizable with headers, footers, and styles
  • Works with Flutter mobile, web, and desktop
  • Supports saving in documents or temporary directory
  • Access file path and raw bytes for sharing

To use import the advanced_html_to_pdf package: #

import 'package:advanced_html_to_pdf/advanced_html_to_pdf.dart';

How to use AdvancedHtmlToPdf property:

Example 1. Create HTML to PDF to get Path:

var htmlContent = """
    <html>
      <body>
        <h1>Hello, PDF!</h1>
        <p>This PDF was generated from HTML.</p>
      </body>
    </html>
  """;
final path = await AdvancedHtmlToPdf.fromHtmlToFile(
  htmlContent,
  options: HtmlToPdfOptions(filename: "demo"),
);

Example 2. Create HTML to PDF to get File Object:

var htmlContent = """
    <html>
      <body>
        <h1>Hello, PDF!</h1>
        <p>This PDF was generated from HTML.</p>
      </body>
    </html>
  """;
final path = await AdvancedHtmlToPdf.fromHtmlToFileObject(
  htmlContent,
  options: HtmlToPdfOptions(filename: "demo"),
);

Example 3. Create HTML to PDF to get fromHtmlToBytes:

var htmlContent = """
    <html>
      <body>
        <h1>Hello, PDF!</h1>
        <p>This PDF was generated from HTML.</p>
      </body>
    </html>
  """;
final path = await AdvancedHtmlToPdf.fromHtmlToBytes(
  htmlContent,
  options: HtmlToPdfOptions(filename: "demo"),
);

Here is the output: View Demo PDF

📦 Installation #

Add this to your pubspec.yaml:

dependencies:
  advanced_html_to_pdf: ^0.0.1

Issues & Feedback #

Please file an issue to send feedback or report a bug,
If you want to ask a question or suggest an idea then you can open an discussion.
Thank you!

Contributing #

Every pull request is most welcome 🤝.

Support #

If this package saves your time. You can now buy me a coffee!

Scan bellow QR code or click and don't forget to leave a message there:

Buy Me A Coffee

0
likes
150
points
58
downloads

Publisher

verified publisher1morecode.com

Weekly Downloads

A Flutter package to easily convert HTML content into high-quality PDF documents.

Repository (GitHub)
View/report issues

Topics

#pdf #html #converter #html-to-pdf #html-to-pdf-converter

Documentation

API reference

License

MIT (license)

Dependencies

flutter, path_provider, pdf, printing

More

Packages that depend on advanced_html_to_pdf