承接 mober/phpsvg 相关项目开发

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

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

mober/phpsvg

最新稳定版本:v6.0.0-beta.2

Composer 安装命令:

composer require mober/phpsvg

包简介

Edit and create SVG Documents using OO PHP

关键字:

README 文档

README

Edit and create SVG documents using PHP. This library is a fork of mewebstudio/phpsvg, which was last updated in 2013.

Features

  • Open and edit SVG and SVGZ (GZipped)
  • Generate thumbnails or export to PNG, JPG, GIF, PS, EPS, PDF
  • Support embedded or linked images
  • Strict typing, i.e. declare(strict_types=1);

Installation

  • Version 4.x supports PHP 8.0 and newer, because some features (like fluent methods) require language features that were not available in earlier versions.
  • Version 3.x is no longer maintained and supports PHP 7.1 to 8.0.

Install using composer:

composer require mober/phpsvg

Example

$svg = new SVGDocument();

$gradient = new SVGLinearGradient([
    // Set style using fluent methods
    (new SVGStop(0))->setColor('blue')->setOpacity(1),
    (new SVGStop(0.8))->setColor('cyan')->setOpacity(0.5),
]);
$svg->addDefs($gradient);
$svg->addShape(
    new SVGRect(10, 20, '100', '200', (new SVGStyle())->setFill($gradient))
);

$radial = new SVGRadialGradient([
    // Set style as string
    new SVGStop(0, 'stop-color:yellow;stop-opacity:1'),
    new SVGStop(0.7, 'stop-color:green;stop-opacity:1'),
]);
$svg->addDefs($radial);
$svg->addShape(
    new SVGCircle(250, 120, 100, (new SVGStyle())->setFill($radial))
);

$svg->writeXML('demo.svg', humanReadable: true);

统计信息

  • 总下载量: 2.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2020-12-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固