Skip to content

dwg2pdf

将 DWG/DXF 图形导出为 PDF 文件的命令行工具。

Usage: ./dwg2pdf [OPTIONS]... <drawing file>
Converts a drawing file (DWG, DXF, ...) to a PDF file.
-a, -auto-fit Auto fit and center drawing to paper
-auto-orientation Auto paper orientation (landscape or portrait)
based on document bounding box
-block=BLOCK_NAMES Comma-separated list of block(s) or
layout(s) to export
List may include regular expressions
List defines order of export unless
-block-sort is used
A block may be exported more than once
unless -block-unique is used
-block-sort Sort blocks in natural order
Layouts are sorted by tab order
and exported before blocks
Blocks are ordered alphanumerically
-block-unique Export every matching block only once
-c, -center Auto center drawing on paper
-color-correction Enable color correction to prevent white on white
or black on black painting
-d, -recompute-dim Recompute dimension blocks if empty
(dimensions rendered with best compatibility)
-e, -papers List all supported paper size names
-point-size=SIZE Set size of points in mm
-f, -force Overwrite existing output file
-flat Flatten to 2D (Z==0)
-fs, -font-substitution FONT1 FONT2
Substitute FONT1 with FONT2
-h, -help Display this help
-k, -grayscale Grayscale
-l, -landscape Landscape (default is portrait)
-layer=LAYER_NAMES Comma-separated list of layer(s) to export
List may include regular expressions
-list-printers List all available printers
-ltscale=FACTOR Set linetype scale to FACTOR
-m, -margin=M Set paper margins to M
-n, -monochrome Monochrome (black / white)
-o, -outfile=FILE Set output file to FILE
default is same path and base name as input file
-offset=X,Y Set offset to X,Y in drawing units
('3,4', '7/2,1/4', '0.5,-1.5', ...)
-p, -paper=WxH Set paper size to W x H in mm or to named paper size
('A4', 'Letter', ...)
-pdf-version=VER Specify PDF version to
'1.4' (default) for PDF 1.4
'1.6' for PDF 1.6
'A' or 'A-1B' or 'A1B' for PDF/A-1B
-printer=PRINTER Print directly to PRINTER or default printer
if no printer given
-rows=ROWS Set number of paper rows to ROWS
-s, -scale=SCALE Set drawing scale to given scale
('1', '2', '0.5', '1:1', '1:5', '5:1', ...)
-cols=COLS Set number of paper columns to COLS
-u, -unit=[in|m|mm] Assume input data to be in given unit
Default is the drawing unit
Mainly useful for drawings with unit 'None'
-w, -min-lineweight=LW Set minimum line weight on paper to LW Millimeter
-max-lineweight=LW Set maximum line weight on paper to LW Millimeter
macOS specific options:
-no-dock-icon Don't show icon in dock. This should only be used
in combination with -no-gui.
Qt/X11 platform arguments:
-platform offscreen Run without requiring an X11 server or display.
Use this argument to run this command line tool in a
Linux server environment.
Qt/X11 environment variables:
QT_QPA_FONTDIR Set to fonts directory in a server environment, e.g. 'fonts/qt'.