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 I386 Laravel Package

h4cc/wkhtmltopdf-i386

Composer package that bundles the 32-bit Linux wkhtmltopdf binary, so PHP and Laravel apps can convert HTML to PDF without a system-wide install. Works well with Snappy-style wrappers for invoices, reports, and other printable documents. 32-bit only; check architecture compatibility before use.

Deep Wiki
Context7

Technical Evaluation

Architecture fit. The name is misleading: this is not a PHP library. h4cc/wkhtmltopdf-i386 is a Composer-delivered binary payload — a precompiled 32-bit Linux x86 build of wkhtmltopdf (QtWebKit) plus a thin composer.json that exposes it under vendor/bin/. There is no PHP API, no service provider, no config surface. Its architectural role in a Laravel app is narrow and well-understood: it supplies the binary path consumed by a wrapper such as barryvdh/laravel-snappy or knplabs/knp-snappy, which shells out to the executable and captures the PDF from stdout or a temp file. Fit is therefore conditional on the wrapper, not on this package — the package is a swappable path in a config file.

Integration feasibility. Trivially easy to wire up, which is exactly why it spread. A developer adds the requirement, points config/snappy.php (pdf.binary) at vendor/h4cc/wkhtmltopdf-i386/bin/wkhtmltopdf-i386, and gets a working PDF export in minutes on a matching host. Feasibility collapses outside that envelope: the artifact only executes on Linux/i386 with the correct glibc and Qt/X11 shared objects present. On an amd64 runtime it fails at exec (ENOEXEC / "cannot execute binary file") unless the image has dpkg --add-architecture i386 plus the full 32-bit dependency set installed; on musl/Alpine it cannot run at all; on arm64 (including Apple Silicon developer laptops) it cannot run at all. The practical result is a package that works on the one machine it was first tested on and breaks the moment the build moves to a modern base image or container platform.

Technical risk.

  • Vendor risk — high. Repo is unlisted/unknown, single-maintainer origin, last release 2018-01-15 (7+ years). No issue tracker to file against, no upstream to patch, no CVE feed. composer audit will report nothing because the risk is in an opaque ELF binary, not in PHP code.
  • Security risk — high, and content-dependent. The rendering engine is a long-EOL QtWebKit fork. If any user-supplied or third-party HTML reaches the renderer, you are exposing an unpatched browser engine to arbitrary input. Acceptable only for fully trusted, developer-authored templates.
  • Licensing risk — moderate, requires counsel. LGPL-3.0 on the binary is a distribution obligation, not a use obligation. Shelling out to a separate process is generally the safest posture, but bundling it in a shipped appliance/on-prem image triggers notice, license-text, and source-availability/relinking duties. Confirm whether the Qt linkage in this specific build is dynamic before shipping.
  • Architecture risk — compounding. 32-bit also imposes a ~3GB per-process address-space ceiling; wkhtmltopdf is memory-hungry on long documents, so large reports can OOM in a way the amd64 build would survive.
  • Version risk. Because it is PHP-agnostic, PHP 8.x compatibility is a non-issue — which is the trap. Nothing in Composer's dependency graph will ever flag this as stale, so it silently persists in composer.lock for years.

Key questions. What is the actual deployment architecture (amd64 container? arm64? bare metal)? Is the input HTML ever user-controlled? Does the product ship an on-prem/self-hosted artifact, and has legal ruled on LGPL redistribution? Which wrapper (Snappy, or bespoke) owns the process invocation, timeouts, and cleanup? Do current templates depend on CSS/JS features that only a newer engine provides? Is there a documented PDF-fidelity SLA, and who owns golden-file regression tests today?

Integration Approach

Stack fit. Treat this package as a replaceable external dependency, not a library. The correct target state is: the Laravel application depends on a PDF abstraction (PDF::render($view, $data)) backed by a driver; the driver resolves an executable path from config; the executable is provisioned by the infrastructure layer (Dockerfile or host provisioning), not by Composer. That single refactor removes the binary from the PHP dependency graph and turns an architectural commitment into a configuration detail.

Migration path. Two independent moves, deliberately separated so you never change engine and provisioning simultaneously:

  1. De-Composer the binary. Remove h4cc/wkhtmltopdf-i386; install wkhtmltopdf 0.12.6 (the last upstream release) via the distro package or a maintained container image matching your real architecture; point snappy.pdf.binary at the system path. Behaviour is preserved; risk drops immediately.
  2. De-wkhtmltopdf the renderer (as a separate initiative). wkhtmltopdf is itself in maintenance mode. If templates need modern CSS (flexbox/grid), or if you must eliminate the EOL-engine exposure, plan a move to headless Chrome (Browsershot/Puppeteer in a sidecar) or to a managed rendering API. Dompdf is a cheaper fallback but a fidelity regression; do not position it as a lateral move.

Compatibility. Build the matrix explicitly before touching anything: dev laptops (arm64 — this package is dead here), CI runners, staging, production, and any customer-hosted deployment. Confirm glibc vs musl, whether the base image is amd64, and whether font packages (DejaVu, Liberation, and any brand fonts) are installed — missing fonts are the single most common "it works locally" PDF defect. Verify that no build step strips or symlinks vendor/bin artifacts.

Sequencing.

  1. Pin the current version and freeze new adoption; add a code comment marking it deprecated.
  2. Inventory every call site, wrapper config, and template; snapshot current PDF output as golden files.
  3. Stand up the system-binary path in one environment; diff outputs.
  4. Roll environment by environment; keep the old path behind a config flag for one release.
  5. Only then begin the engine evaluation, driven by the fidelity test suite rather than by vendor pressure.

Operational Impact

Maintenance. Near-zero code maintenance, which is precisely the danger: no one is watching it. Establish an explicit ownership line — a named owner, a calendar review, and an entry in the dependency register flagged "binary artifact, no upstream, EOL engine." Budget for the eventual forced migration rather than for incremental patching; there will be no patches.

Support. Supportability is the weakest dimension. When a render fails, the diagnostic is a Qt message on stderr, an ambiguous exit code, and a stack trace that terminates at Symfony\Process. There is no upstream to escalate to and no changelog to consult. Expect engineering to spend disproportionate time on environment archaeology (missing libjpeg, libXrender, font caches, QT_QPA_PLATFORM=offscreen) rather than on product problems. Developer-experience cost is concentrated on non-Linux and arm64 machines, where local reproduction is impossible.

Scaling. The scaling model is process-per-render with no pooling and no thread safety — model it as a worker pool, not a service call. Each invocation is memory-heavy (plan on hundreds of MB peak for image-rich or long documents, capped by the 32-bit address-space ceiling). Render on queued jobs with a bounded concurrency per host, never inline in a web request. Apply hard wall-clock timeouts (Process::setTimeout) — a template with a runaway script or a remote asset that never resolves will otherwise hang a worker indefinitely — and enforce external resource allow-lists so the renderer cannot stall on third-party CDNs.

Failure modes. Enumerate and monitor each: (1) architecture/exec failure — loud, immediate, caught in CI if CI matches prod; (2) missing shared library or font — silent until a specific template renders, produces tofu glyphs or a blank page; (3) unpatched-engine exploit via untrusted HTML; (4) memory exhaustion at the 32-bit ceiling on long reports; (5) orphaned/zombie processes and leaked temp files after timeouts; (6) non-deterministic output across hosts due to font and version drift. Alert on non-zero exit rate and on render-duration percentiles; add a synthetic canary render to health checks.

Ramp-up. Individual contributor ramp-up is minutes — the wrapper API is one method call. Operational ramp-up is the real cost: understanding the container's 32-bit compatibility layer, diagnosing Qt shared-object failures, and knowing which templates are fragile. That knowledge is scarce, undocumented, and concentrated in whoever set it up originally — a key-person risk that argues for the de-Composer migration as a near-term, low-effort win independent of any engine decision.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings