承接 laratusk/larasvg 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laratusk/larasvg

Composer 安装命令:

composer require laratusk/larasvg

包简介

A modern Laravel package for SVG conversion with multiple provider support (Resvg, Inkscape, rsvg-convert). Convert SVG to PNG, PDF, EPS, and more.

README 文档

README

LaraSVG Banner

Latest Version PHP Version Laravel Version Tests License

A modern Laravel package for SVG conversion with multiple provider support. Convert SVG files to PNG, PDF, EPS, and more using a fluent API and Laravel's Process facade.

Battle-Tested

Backed by over 80 million SVG-to-format conversions in production across three years, this codebase is truly battle-tested. Releasing it as a package was the logical evolution.

Requirements

  • PHP 8.2+
  • Laravel 10.x, 11.x, 12.x, or 13.x
  • At least one converter installed:
    • Resvg — recommended for PNG
    • Inkscape 1.0+ — for PDF, EPS, PS, EMF, WMF
    • rsvg-convert — lightweight, PNG/PDF/PS/EPS/SVG
    • CairoSVG — Python-based, PNG/PDF/PS/SVG

Quick Install

composer require laratusk/larasvg
php artisan larasvg:setup

Documentation

Visit the full documentation for detailed guides, usage examples, API reference, and more.

Features

  • Multi-provider architecture — Switch between Resvg, Inkscape, rsvg-convert, and CairoSVG with a single method call
  • Resvg (default) — Lightning-fast SVG to PNG conversion
  • Inkscape — Full-featured SVG conversion to PNG, PDF, PS, EPS, EMF, WMF
  • rsvg-convert — Lightweight librsvg tool for PNG, PDF, PS, EPS, and SVG output
  • CairoSVG — Python-based converter using the Cairo 2D library; PNG, PDF, PS, SVG
  • Custom drivers — Register your own converter via config or SvgConverter::extend() — no package code changes needed
  • Fluent API — Chainable methods for dimensions, background, format, and provider-specific options
  • Laravel Filesystem — Read from and write to any Laravel disk (S3, local, etc.)
  • Stdout output — Pipe conversion output directly to stdout for streaming responses
  • Facade — Clean SvgConverter:: static API with IDE autocompletion
  • Testable — Built on Laravel's Process facade with full Process::fake() support
  • Setup command — Interactive php artisan larasvg:setup to detect and install providers

Supported Formats

Format Resvg Inkscape rsvg-convert CairoSVG
PNG Yes Yes Yes Yes
PDF Yes Yes Yes
SVG Yes Yes Yes
PS Yes Yes Yes
EPS Yes Yes
EMF Yes
WMF Yes

Quick Start

use Laratusk\Larasvg\Facades\SvgConverter;

// Default provider (Resvg)
SvgConverter::open(resource_path('svg/file.svg'))
    ->setFormat('png')
    ->setDimensions(1024, 1024)
    ->toFile(storage_path('app/output.png'));

// Switch provider per call
SvgConverter::using('inkscape')
    ->open(resource_path('svg/file.svg'))
    ->setFormat('pdf')
    ->toFile(storage_path('app/output.pdf'));

SvgConverter::using('cairosvg')
    ->open(resource_path('svg/file.svg'))
    ->setFormat('pdf')
    ->setScale(2.0)
    ->toFile(storage_path('app/output.pdf'));

Contributing

Please see CONTRIBUTING.md for details.

License

MIT License. See LICENSE for details.

统计信息

  • 总下载量: 939
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 32
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 32
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固