Skip to content
Search

CairoSVG

lastmod 2026-11-10created 2024-03-312 edits

CairoSVG is a Python library and command-line tool that converts SVG files to PNG, PDF, and PostScript. It uses the 2D graphics library Cairo as its backend to parse and render SVG elements; you can call it directly from code with functions such as cairosvg.svg2png() or convert files from the shell. It is used when SVG needs to be rasterized on a server without an external browser or Inkscape, and WeasyPrint, which converts HTML to PDF, uses this library for SVG handling.

A Simple SVG Converter based on Cairo

See also

Favorite site

author Zer0, MCPBot sitemap