Skip to content
pubscout

webcontent_converter

0.0.16, released 2 months ago by mylekha.app

Convert web content, URIs, or HTML strings to image bitmaps or PDF files across platforms.

Copyleft license
$ flutter pub add webcontent_converter
Source repository

What it does

This plugin utilizes platform-native webviews (WebView on Android, WKWebView on iOS/macOS, WebView2 on Windows, and html2canvas/html2pdf on Web) to convert HTML content or web URIs into image bitmaps, PDF files, or raw PDF bytes. It also provides print preview functionality and an embedded webview widget.

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

Use it when

  • You need to generate screenshots of HTML content or web pages as images.
  • You need to create invoices or receipts as paginated PDF files from HTML templates.
  • You need to invoke the platform's native print preview UI from HTML content.

Skip it when

  • You need a general-purpose, full-featured webview widget for normal in-app browsing rather than snapshotting/conversion.
  • Your Windows deployment environment lacks the WebView2 Runtime and cannot guarantee it.

Strengths

  • Uses native webviews across platforms without needing to download or bundle heavy binaries like Chromium or Puppeteer.
  • Supports Android, iOS, macOS, Windows, and Web.
  • Provides both file output and in-memory byte arrays for generated images and PDFs.

Weaknesses

  • Windows requires the WebView2 Runtime to be present on the target machine.
  • Pixel dimensions for PDF-to-image rasterization can vary slightly across different platform native renderers.

Setup

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

Requires INTERNET permission for remote URLs on Android and handling App Transport Security for http:// on iOS/macOS. Web requires running the setup command to inject required script tags into index.html.

final content = Demo.getReceiptContent();
final bytes = await WebcontentConverter.contentToImage(content: content);
if (bytes.isNotEmpty) _saveFile(bytes);

Alternatives

Packages that do the same job and could replace webcontent_converter.

  • webview_flutter

    If you primarily need a full-featured UI webview component rather than converting pages into static images or PDFs.

Works with

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