1. 程式人生 > >dot生成pdf格式圖片

dot生成pdf格式圖片

dot可以生成很多種格式的檔案,最常用的是png,但是還是有很多的格式可以生成。

官方網站中給出:http://www.graphviz.org/content/output-formats

bmp Windows Bitmap Format
CGImage bitmap format
cmap Client-side imagemap (deprecated)
eps Encapsulated PostScript
exr OpenEXR
fig FIG
gd 
gd2
GD/GD2 formats
gif GIF
gtk GTK canvas
ico Icon Image File Format
imap
 
cmapx
Server-side and client-side imagemaps
Server-side and client-side imagemaps
ismap Server-side imagemap (deprecated)
jp2 JPEG 2000
jpg 
jpeg 
jpe
JPEG
Dot graph represented in JSON format
pct 
pict
PICT
pdf Portable Document Format (PDF)
pic Kernighan's PIC graphics language
Simple text format
png
Portable Network Graphics format
pov POV-Ray markup language (prototype)
ps PostScript
ps2 PostScript for PDF
psd PSD
sgi SGI
svg 
svgz
Scalable Vector Graphics
tga Truevision TGA
tif 
tiff
TIFF (Tag Image File Format)
tk TK graphics
vml 
vmlz
Vector Markup Language (VML)
vrml VRML
wbmp Wireless BitMap format
webp Image format for the Web
xlib 
x11
Xlib canvas

具體實現命令為:(已驗證)

png: dot graph1.gv -Tpng -o test.png

pdf: dot graph1.gv -Tpdf -o test.pdf

其他格式尚未驗證,猜測為

xxx: dotgraph1.gv -Txxx -o test.xxx