dot生成pdf格式图片

本文介绍了如何利用dot工具从gv文件生成不同格式的图形,重点在于使用命令行生成PDF格式的图片。通过`dot graph1.gv -Tpdf -o test.pdf`,可以将图转换为高质量的PDF。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

dot可以生成很多种格式的文件,最常用的是png,但是还是有很多的格式可以生成。

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

bmpWindows Bitmap Format
canon 
dot 
gv 
xdot 
xdot1.2 
xdot1.4
DOT
cgimageCGImage bitmap format
cmapClient-side imagemap (deprecated)
epsEncapsulated PostScript
exrOpenEXR
figFIG
gd 
gd2
GD/GD2 formats
gifGIF
gtkGTK canvas
icoIcon Image File Format
imap 
cmapx
Server-side and client-side imagemaps
imap_np 
cmapx_np
Server-side and client-side imagemaps
ismapServer-side imagemap (deprecated)
jp2JPEG 2000
jpg 
jpeg 
jpe
JPEG
json 
json0 
dot_json 
xdot_json
Dot graph represented in JSON format
pct 
pict
PICT
pdfPortable Document Format (PDF)
picKernighan's PIC graphics language
plain 
plain-ext
Simple text format
pngPortable Network Graphics format
povPOV-Ray markup language (prototype)
psPostScript
ps2PostScript for PDF
psdPSD
sgiSGI
svg 
svgz
Scalable Vector Graphics
tgaTruevision TGA
tif 
tiff
TIFF (Tag Image File Format)
tkTK graphics
vml 
vmlz
Vector Markup Language (VML)
vrmlVRML
wbmpWireless BitMap format
webpImage 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值