Skip to content

Instantly share code, notes, and snippets.

@cyberhobo
Created January 2, 2017 17:36
Show Gist options
  • Save cyberhobo/1845e68063224e5cee69298a11355401 to your computer and use it in GitHub Desktop.
Save cyberhobo/1845e68063224e5cee69298a11355401 to your computer and use it in GitHub Desktop.
<?php
require __DIR__ . '/vendor/autoload.php';
use JangoBrick\SVG\SVGImage;
$image = SVGImage::fromFile('test.svg');
$image->getDocument()->setAttribute( 'viewBox', '20 20 200 200' );
$rasterImage = $image->toRasterImage( 480, 480 );
imagepng( $rasterImage, 'test.png' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment