1. Go to this page and download the library: Download krak/svg library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$string_serializer = new Krak\Svg\StringSvgSerializer();
$png_serializer = new Krak\Svg\RsvgCliSvgSerializer($string_serializer);
$svg_string_data = $string_serializer->serializeSvg($svg);
$svg_png_data = $png_serializer->serializeSvg($svg);
foreach (krak\svg\iter_top_down($svg) as $depth => $el) {
// ...
}
foreach (krak\svg\iter_bottom_up($svg) as $depth => $el) {
// ...
}
/* the following are just aliases of what's above */
foreach (new Krak\Svg\TopDownIterator($svg) as $depth => $el) {
// ..
}
foreach (new Krak\Svg\BottomUpIterator($svg) as $depth => $el) {
// ..
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.