Convert SVG image to PNG with PHP

后端 未结 8 2203
没有蜡笔的小新
没有蜡笔的小新 2020-11-22 14:46

I\'m working on a web project that involves a dynamically generated map of the US coloring different states based on a set of data.

This SVG file gives me a good b

8条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 15:35

    I do not know of a standalone PHP / Apache solution, as this would require a PHP library that can read and render SVG images. I'm not sure such a library exists - I don't know any.

    ImageMagick is able to rasterize SVG files, either through the command line or the PHP binding, IMagick, but seems to have a number of quirks and external dependencies as shown e.g. in this forum thread. I think it's still the most promising way to go, it's the first thing I would look into if I were you.

提交回复
热议问题