phenx/php-svg-lib
A lightweight PHP library for reading, parsing, and rendering SVG files. It handles paths, basic shapes, gradients, text, styles, and CSS, and is best known as the SVG engine behind Dompdf, letting PHP applications embed vector graphics in generated PDFs without external dependencies.
Surface interface is backend-agnostic, this can serve more than one output channel: PDF via a Dompdf-style surface, PNG/raster via a GD or Imagick surface, or a custom canvas for previews. That supports a roadmap direction of "one asset pipeline, many outputs" instead of per-format SVG handling.Adopt when:
imagick, no headless browser, no system binaries.Look elsewhere when:
<use> graphs, full font shaping. Expect visible drift from a designer's source file; validate against your actual asset library before committing.Surface implementation, which is real engineering work and a real ongoing cost.To executives (one paragraph): We can deliver PDF export with sharp, professionally rendered vector graphics — logos, charts, seals, and icons that stay crisp at any zoom level and keep file sizes small — by adopting a small, actively maintained open-source PHP library that already powers SVG support in the most widely used PHP PDF engine. The cost is a Composer dependency and a few days of integration, versus several weeks and a permanent maintenance burden to build equivalent parsing ourselves. The one item requiring a decision is licensing: the library is LGPL-3.0, which is fine for standard SaaS delivery but needs a short legal review before we ship it inside any on-premise or redistributed build. Recommendation: approve for SaaS use now, run legal review in parallel, and keep the integration behind our own rendering interface so the dependency stays swappable.
To engineering (the substance):
Surface interface: we implement a surface, the library hands us normalized drawing operations. That gives us a clean seam to swap renderers, add a raster surface later, or test rendering without a full PDF pipeline.How can I help you explore Laravel packages today?