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
Wkhtmltopdf Amd64

Wkhtmltopdf Amd64 Laravel Package

h4cc/wkhtmltopdf-amd64

Static, precompiled wkhtmltopdf binaries for Linux amd64 installable via Composer. Version matches git tags (e.g., 0.12.4). Provides a PATH constant to locate the binary in code and creates a vendor/bin symlink for easy execution.

View on GitHub
Deep Wiki
Context7

wkhtmltopdf - Convert html to pdf using webkit (qtwebkit). Linux amd64 Binary.

Frequently asked questions about Wkhtmltopdf Amd64
How do I install wkhtmltopdf-amd64 in a Laravel project?
Run `composer require h4cc/wkhtmltopdf-amd64` to install the package. The binary will be available at `vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf` or symlinked to `vendor/bin/wkhtmltopdf`. Ensure your Laravel app runs on Linux amd64, as this package only supports that architecture.
Can I use this package with Laravel 9 or PHP 8.x?
The package supports PHP 5.6+, but no active maintenance post-2018 means compatibility with PHP 8.x or Laravel 9 isn’t guaranteed. Test thoroughly in a Docker container using `ubuntu:20.04` or `debian:bullseye` to avoid issues with deprecated functions or binary dependencies.
How do I generate PDFs from Blade templates in Laravel?
Use Laravel’s `Process` facade or `shell_exec` to call the binary. For example, pass a Blade-rendered HTML string to `wkhtmltopdf` via a temporary file or pipe. Wrap this logic in a service class for reusability, like `PdfGeneratorService`, and inject it into controllers.
What’s the best way to handle long-running PDF generation in Laravel?
Offload PDF generation to Laravel Queues using a job class (e.g., `GeneratePdfJob`). This prevents timeouts and improves performance. Use Redis or database queues for async processing, and store the resulting PDFs in Laravel’s `Storage` facade (e.g., S3 or local filesystem).
Does this package work in Docker or serverless environments?
This package requires Linux amd64, so Docker is the best option for containerized deployments. Use a base image like `ubuntu:20.04` and install the binary via Composer. Serverless environments (e.g., AWS Lambda) are not ideal due to binary constraints, though you could use ECS or a custom runtime.
Are there alternatives if I need ARM support or lighter PDF generation?
For ARM support, consider `barryvdh/laravel-dompdf` (pure PHP, slower but lightweight) or `spatie/pdf-to-text` for text extraction. For headless Chrome, use Puppeteer via Node.js (e.g., with Laravel Octane or Horizon). If CSS accuracy isn’t critical, `dompdf` is a simpler alternative.
How do I handle errors or crashes in wkhtmltopdf?
Implement retry logic in your job or service class using Laravel’s `retryAfter` or a custom retry mechanism. Log failures with Laravel’s logging system and set up alerts (e.g., Slack or email) for repeated crashes. Fallback to a simpler PDF generator like `dompdf` if wkhtmltopdf consistently fails.
Can I update the wkhtmltopdf binary without breaking my app?
Pin the version in your `composer.json` to avoid unexpected updates. For critical environments, maintain a private patched version or use a wrapper script to manage binary updates. Test updates in a staging environment first, especially if you rely on specific wkhtmltopdf features.
How do I ensure PDFs are generated consistently across environments?
Containerize your app with Docker to standardize the environment. Use a base image with the exact binary version (e.g., `FROM ubuntu:20.04` + `composer require h4cc/wkhtmltopdf-amd64:0.12.4`). Validate PDF output (fonts, tables, CSS) in CI/CD pipelines by comparing against a golden master.
What are the performance implications of using wkhtmltopdf in production?
PDF generation can be resource-intensive, especially for large HTML payloads. Monitor memory/CPU usage and optimize by using async queues. For high-volume apps, benchmark wkhtmltopdf against alternatives like Puppeteer or consider splitting PDF generation into microservices with dedicated resources.
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.
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
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo