简体   繁体   中英

Convert SVG to an image (png, jpg)

Hey i'm encountering the following problem. I want to convert an dinamically generated (through php) SVG image to an image so a user can rightclick and "save image .."

at the moment the image is displayed as an svg for example like this:

<embed id="image_wuerfel" classid="image/svg+xml" 
src="/svg/models.php?s=c&w=5&h=5&l=5&m=1&desc=1&wh=250&wl=250" 
type="image/svg+xml" width="250" height="250">
</embed>

it sends a GET - Request to the models.php, where the SVG image is generated and will be returned.

Is there something like a JS library or something, that converts this into an image file?

您可以使用ImageMagick的Imagick php类。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM