PythonでSVGをPNGに変換するCairoSVG

CairoSVG

CairoSVG

pip install CairoSVG

GitHub – tschoonj/GTK-for-Windows-Runtime-Environment-Installer: GTK+ for Windows Runtime Environment Installer (fork from http://gtk-win.sourceforge.net)

cannot load library 'libcairo-2.dll’: error 0x7e.

このようなエラーが出るので ライブラリーをインストールします gtk

使い方

cairosvg image.svg -o image.png

パラメーター

usage: cairosvg [-h] [-v] [-f {eps,pdf,png,ps,svg}] [-d DPI] [-W WIDTH] [-H HEIGHT] [-s SCALE] [-b COLOR] [-n] [-i]usage: cairosvg [-h] [-v] [-f {eps,pdf,png,ps,svg}] [-d DPI] [-W WIDTH] [-H HEIGHT] [-s SCALE] [-b COLOR] [-n] [-i]   [-u] [--output-width OUTPUT_WIDTH] [--output-height OUTPUT_HEIGHT] [-o OUTPUT]  input

Python

Posted by eightban