コマンドラインからinkscape使用する

inkscape-commandline.png

コマンドラインからinkscape使用する

inkscape-コマンドラインマニュアル

SVGからpngに変換

inkscape -f input.svg -e output.png

意味-fはファイル名 -eはexport to pngという意味である。
☆注….Inkscape0.91にアップデートしてからなぜか、相対パスじゃなくて絶対パスにしないとうまく動いてくれなくなりました
サイズを指定したい場合は 100ピクセルx100ピクセルなら

inkscape -w 100 -h 100 -f input.svg -e output.png

PDFをSVGに変換

inkscape -f input.pdf -l output.svg

Available options:
略式オプション` オプション 意味 使い方
-V, --version Print the Inkscape version number
-z, --without-gui Do not use X server (only process files from console)
-g, --with-gui Try to use X server (even if $DISPLAY is not set)
-f, --file=FILENAME Open specified document(s) (option string may be excluded)
-p, --print=FILENAME Print document(s) to specified output file (use '| program' for pipe)
-e --export-png=FILENAME Export document to a PNG file
-d --export-dpi=DPI Resolution for exporting to bitmap and for rasterization of filters in PS/EPS/PDF (default 90)
-a --export-area=x0:y0:x1:y1 Exported area in SVG user units (default is the page; 0,0 is lower-left corner)
-D --export-area-drawing Exported area is the entire drawing (not page)
-C --export-area-page Exported area is the entire page
--export-area-snap Snap the bitmap export area outwards to the nearest integer values (in SVG user units)
-w --export-width=WIDTH The width of exported bitmap in pixels (overrides export-dpi)
-h --export-height=HEIGHT The height of exported bitmap in pixels (overrides export-dpi)
-i --export-id=ID The ID of the object to export
-j --export-id-only Export just the object with export-id, hide all others (only with export-id)
-t --export-use-hints Use stored filename and DPI hints when exporting (only with export-id)
-b --export-background=COLOR Background color of exported bitmap (any SVG-supported color string)
-y --export-background-opacity=VALUE Background opacity of exported bitmap (either 0.0 to 1.0, or 1 to 255)
-l --export-plain-svg=FILENAME Export document to plain SVG file (no sodipodi or inkscape namespaces)
-P --export-ps=FILENAME Export document to a PS file
-E --export-eps=FILENAME Export document to an EPS file
-A --export-pdf=FILENAME Export document to a PDF file
--export-latex Export PDF/PS/EPS without text. Besides the PDF/PS/EPS, a LaTeX file is exported, putting the text on top of the PDF/PS/EPS file. Include the result in LaTeX like: \input{latexfile.tex}
-T --export-text-to-path Convert text object to paths on export (PS, EPS, PDF)
--export-ignore-filters Render filtered objects without filters, instead of rasterizing (PS, EPS, PDF)
-X --query-x Query the X coordinate of the drawing or, if specified, of the object with —query-id
-Y --query-y Query the Y coordinate of the drawing or, if specified, of the object with —query-id
-W --query-width Query the width of the drawing or, if specified, of the object with —query-id
-H --query-height Query the height of the drawing or, if specified, of the object with —query-id
-S --query-all List id,x,y,w,h for all objects
-I --query-id=ID The ID of the object whose dimensions are queried
-x --extension-directory Print out the extension directory and exit
--vacuum-defs Remove unused definitions from the defs section(s) of the document
--verb-list List the IDs of all the verbs in Inkscape
--verb=VERB-ID Verb to call when Inkscape opens.
--select=OBJECT-ID Object ID to select when Inkscape opens.
--shell Start Inkscape in interactive shell mode.

Help options:
-?, —help Show this help message
—usage Display brief usage message

サポートサイト Wikidot.com