-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I load a svg from my server to make it a png? #65
Comments
Yes, you can use the |
My bad, I forget add I already have the SVG. So how I can call the file? In example you initialize a SVG using this But I want to load the SVG I already have. Is it possible? |
If I understand what you are trying to do, have a look at the README.md file the last section. It explains how you can load an existing SVG from either a string or file. The example outputs the resulting SVG to the browser, but you can easily save the resulting SVG to a file with for example the PHP 'file_put_contents' function. Is that what you are looking for? |
Now I got it. But png is not rendering well. The code
I am not sure, what I am doing wrong? |
This might not be the best way to generate a PNG from an existing SVG file. The internal rasterization component of this library might not be able to properly render the elements in your SVG. I belief there are some limitations with rasterization in this library. If you only are looking for a simple conversion from SVG to PNG, then I would recommend use a library such as Imagick. |
I have already created a SVG, but now I want to make it a png. Is it possible to do so?
The text was updated successfully, but these errors were encountered: