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

Laravel Php Pdf Laravel Package

dskripchenko/laravel-php-pdf

Laravel integration for the PHP-PDF library, making it easy to generate and work with PDF documents inside your Laravel applications. Provides a familiar service-provider setup and a clean, framework-friendly API for creating PDFs.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit This release strengthens the package's position as a thin, idiomatic Laravel adapter over dskripchenko/php-pdf. Both new features are container-resolution extension points (signing.signer, fonts.provider) rather than concrete implementations, which is the correct architectural choice: it keeps CSP/HSM/KMS and font-licensing concerns out of the package and in application or infrastructure code. The PHP_PDF_SIGNER env fallback matches Laravel convention and allows per-environment bindings (local dev fake signer, production HSM) without code changes. For teams already treating PDF rendering as a platform capability, this is a clean seam to own.

Integration feasibility Low-to-moderate. Integration is config-only for existing users: absent signing.signer and fonts.provider keys, behaviour is unchanged (certificate/key from config still applies, fonts.families still governs). The one hard dependency is the php-pdf bump from ^1.16 to ^1.18, and effectively ^1.20 if detached CMS signing is in scope. That is a real upgrade, not a patch, and its PHP-version and API surface must be validated before we commit.

Technical risk

  • Resolved-once signer semantics. "Resolved once" is efficient but has lifecycle implications. Under Octane or long-lived queue workers, a cached CmsSigner may hold a stale HSM session, PIN, or cloud credential. This is the highest-risk item in the release and needs explicit investigation.
  • Visual output change. The bold/italic face fix alters rendered PDFs for any family configured in fonts.families. This will break pixel/byte-level snapshot tests and may change already-approved document templates. It is a correctness fix, but it is user-visible.
  • Transitive dependency risk. Advancing the php-pdf floor pulls in upstream changes across 1.16 → 1.18/1.20 that are not described here and are outside this package's changelog.
  • Version-gated behaviour. signDetached() + CmsSigner now fails loudly on <1.20. That is better than a TypeError, but it means a partial upgrade can produce a runtime guard rather than a compile-time one.

Key questions

  1. Is the signer resolved once per request/job, or once per process lifetime? What is the documented behaviour under Octane and Horizon?
  2. What is the recovery path when a cached signer's HSM/KMS session expires mid-worker-lifetime — re-resolution, retry, or hard failure?
  3. Is there a published contract/interface for Signer and FontProvider, or are we binding to php-pdf concrete classes?
  4. What are the PHP version and extension requirements of php-pdf 1.18–1.20, and do they match our production runtime?
  5. Does the font face fallback to regular silence misconfiguration, or is it logged?
  6. Is the font provider's output cached across requests, and where does that cache live?

Integration Approach

Stack fit Fits standard Laravel service-provider patterns with no framework version assumptions introduced by this release. The two new config keys are additive and namespaced (signing.*, fonts.*), so a published config file can be merged without conflict. Works naturally alongside existing queue-based rendering and scheduled document generation.

Migration path

  1. Bump the php-pdf constraint to ^1.18 (or ^1.20 if detached CMS signing is required) and review the upstream changelog for 1.16 → 1.20 before locking.
  2. Re-publish/merge the package config; confirm signing.signer and fonts.provider default to null and that the existing certificate/key path still takes precedence when they are unset.
  3. Run the full rendering regression suite — expect diffs wherever bold/italic text uses a configured family. Triage each diff as intended fix vs. template regression, and re-baseline deliberately.
  4. Introduce signing.signer first in a non-production environment behind a fake or dev signer, then against a staging HSM/KMS.
  5. Introduce fonts.provider only where font licensing prevents bundling Liberation/Arial aliases in the repo.

Compatibility Primary gating factors are the PHP runtime and the upstream library floor. Any consumer pinned to older php-pdf will need a coordinated bump. The signDetached + CmsSigner path requires ^1.20 and will otherwise raise a clear error — treat that as a hard prerequisite in acceptance criteria, not a nice-to-have. No breaking changes to this package's public API are signalled.

Sequencing Dependency bump and lockfile audit → config merge with all new keys inert → visual regression pass and re-baselining → signer binding validated in staging → font provider opt-in per deployment → production rollout with signing enabled last, since it carries the external-system dependency.

Operational Impact

Maintenance Ongoing cost is low at the package level (two config keys, one bug fix) but the coupling to php-pdf is now the dominant maintenance vector: we are tracking an upstream library whose releases gate our signing capabilities. Budget a standing task for upstream version review rather than treating this as a one-off bump.

Support Two new classes of support ticket appear. First, signer resolution failures — the error surface will point at container binding rather than at PKI, so first-line support needs a runbook mapping symptoms to "check binding, check HSM reachability, check credential expiry." Second, "bold text renders as regular" reports, which this release fixes but which may now surface as changed document appearance on previously signed or archived templates.

Scaling Signer resolution being cached is good for throughput but potentially bad for concurrency: PKCS#11 tokens and many HSMs serialize cryptographic operations, so horizontal worker scaling will not necessarily scale signing throughput. Font provider calls during rendering may pull and cache font binaries; verify memory footprint per worker before enabling broadly. Plan capacity around the signer, not the renderer.

Failure modes

  • Expired or rotated certificate in the bound signer — documents fail to sign, likely at the end of a long render.
  • HSM/KMS unreachable or session-expired in a long-lived worker — stale cached signer, no automatic recovery unless we build it.
  • Partial upgrade where signDetached runs against php-pdf <1.20 — explicit error, but only at call time.
  • Font provider throwing on an unknown family — rendering failure mid-document.
  • Silent fallback of an unconfigured bold/italic face to regular — degraded emphasis, visually subtle, easy to ship unnoticed without snapshot coverage.

Ramp-up For teams using the package as-is (render, no signing, fonts bundled in the repo): near zero — a dependency bump and a regression pass. For teams adopting the signer binding: substantial. It requires PKI and HSM/KMS fluency that most application teams do not have in-house; expect to involve platform or security engineering, and treat the first integration as a joint effort with an explicit acceptance test for signing under load and across worker restarts. The font provider is a smaller but non-trivial ask, since it implies owning font licensing and distribution decisions.

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.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log