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.
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.
87Compare
Works with
Packages commonly used together with webcontent_converter: ones it builds on, ones built on it, and its own family.
- archivewebcontent_converter depends on itEncodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.
- webwebcontent_converter depends on itLightweight bindings for browser APIs via JS interop
- argswebcontent_converter depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- path_providerwebcontent_converter depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- diowebcontent_converter depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- easy_loggerwebcontent_converter depends on itA lightweight Flutter logger with configurable levels, build‑mode control and custom printer.