Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Html2Media Laravel Package

institut-agro-ead/html2media

A Laravel/PHP package for converting HTML into media such as images or PDFs. Generate visual assets from Blade views or raw markup via a simple, configurable API—useful for reports, thumbnails, social cards, and automated document generation.

View on GitHub
Deep Wiki
Context7

html2media is a Laravel package that converts HTML markup into downloadable media files, giving you a simple, consistent API for turning views, raw HTML strings, or Blade templates into images and documents. It fits naturally into reporting, invoicing, and export workflows where content is authored as HTML but delivered as a file.

  • Render Blade views or raw HTML with a fluent, chainable API
  • Configurable output formats and page/canvas dimensions
  • Works with Laravel storage for saving or streaming downloads
  • Publishable config for driver and rendering options
  • Designed for testability with a clean service-container binding
Frequently asked questions about Html2Media
What is institut-agro-ead/html2media used for in Laravel?
Html2Media converts HTML markup, including Blade views, into PDFs or image files in a Laravel application. It is intended for documents such as invoices, reports, thumbnails, and shareable snapshots. You can return the result as a download, stream it, print it, or save it to disk or Laravel storage.
How do I install the Html2Media package with Composer?
Install it via Composer using the package name institut-agro-ead/html2media. Run composer require institut-agro-ead/html2media from your Laravel project root. After installation, check the README for any required provider registration or publishable configuration for your Laravel version.
How do I convert a Blade view to a PDF with Html2Media?
Render the Blade view to HTML in your controller or action, then pass that markup to the package conversion API. The package handles the HTML-to-PDF step and lets you choose download, print, or storage output. Because it works from HTML, you can reuse existing Laravel views and data for invoices and reports.
Can Html2Media generate images as well as PDFs?
Yes, the package is described as rendering HTML to images or PDFs. Use the PDF output for documents and reports, and image output for thumbnails or shareable snapshots. The exact image format and available options should be confirmed in the package documentation.
How do I configure the PDF file name, orientation, and margins?
Html2Media exposes configurable settings for file name, orientation, and margins. You typically set these options when invoking the conversion so each generated document can differ by context. Review the package configuration and method signatures for the supported keys and default values.
Can I save generated PDFs to Laravel storage instead of downloading them?
Yes, the package supports saving results to disk or Laravel storage as well as streaming or downloading them. This is useful when you need to keep generated invoices or reports for later retrieval. Use Laravel filesystem disks to control local or cloud storage locations.
Does Html2Media integrate with Filament actions?
Yes, the overview mentions integration with Filament actions for dynamic content rendering. That lets you generate PDFs or media from HTML inside Filament admin panels and actions. Confirm the supported Filament versions and required setup in the package documentation.
What Laravel versions does Html2Media support?
The provided package information does not list specific Laravel version constraints. Check the package composer.json and README for the exact PHP and Laravel requirements before installing. For production, match those constraints to your application framework版本.
Is Html2Media suitable for invoices and reports in production?
It is designed for documents, invoices, reports, and similar HTML-based output, and it supports downloading, printing, storage, and configurable layout options. Before production use, test your actual templates, fonts, margins, and output quality in your environment. Also review asset loading and conversion performance for large documents.
How does Html2Media compare to other Laravel HTML-to-PDF packages?
Html2Media focuses on a simple HTML-to-PDF and HTML-to-image workflow with download, print, storage, and Filament action support. Compared with broader PDF packages, its value is the streamlined media output and configurable document settings. Evaluate it against your need for templating features, PDF engine choice, and long-term maintenance.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect