2017 © Pedro Peláez
 

library phpsvg

Edit and create SVG Documents using OO PHP

image

nplavsic/phpsvg

Edit and create SVG Documents using OO PHP

  • Monday, January 8, 2018
  • by nikolaplavsic
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 2 Versions
  • 80 % Grown

The README.md

phpsvg

Edit and create SVG Documents using OO PHP, (*1)

Features:

  • Open and edit SVG and SVGZ (GZipped)
  • Generate thumbnails or export to PNG, JPG, GIF,PS,EPS,PDF
  • Support embebed or linked images.
  • Use php features: SimpleXMLElement, GZip, Gd, Imagemagick.
  • Can use inkscape to export some image formats.

Is in development., (*2)

Code example:

require_once "svglib.php";



$svg = SVGDocument::getInstance( 'resource/apple.svg' ); //open to edit

//$svg = SVGDocument::getInstance( ); //default read to use



$rect = #create a new rect with, x and y position, id, width and heigth, and the style

$rect = SVGRect::getInstance( 0, 5, 'myRect', 228, 185, new SVGStyle( array( 'fill'   => 'red', 'stroke' => 'blue' ) ) );

$svg->addShape( $rect );



$text = SVGText::getInstance( 22, 50, 'myText', 'This is a text', $style );



$svg->asXML('output/output.svg'); //output to svg file

$svg->export('output/output.png'); //export as png

$svg->export('output/thumb32x32.png',32,32); //export thumbnail

$svg->output(); //echo with header to browser

?>

The Versions

08/01 2018

dev-master

9999999-dev https://github.com/nikolaplavsic/phpsvg

Edit and create SVG Documents using OO PHP

  Sources   Download

GPL-3.0

by Nikola Plavsic
by Dampfklon
by Eduardo Bonfandini

php svg

29/12 2017

0.9.0

0.9.0.0 https://github.com/nikolaplavsic/phpsvg

Edit and create SVG Documents using OO PHP

  Sources   Download

GPL-3.0

by Nikola Plavsic
by Dampfklon
by Eduardo Bonfandini

php svg