The command line script ezdxf launches various sub-commands:

pp DXF pretty printer, replacement for the previous dxfpp command
audit Audit and repair DXF files
draw Draw and convert DXF files by the Matplotlib backend
view PyQt DXF file viewer
browse PyQt DXF structure browser for DXF debugging and curious people
strip Strip comments and THUMBNAILIMAGE section from DXF files
config Manage config files

The help option -h is supported by the main script and all sub-commands:

C:\> ezdxf -h
usage: ezdxf [-h] [-V] [-v] [--config CONFIG] [--log LOG]
             {pp,audit,draw,view,browse,strip,config} ...

Command launcher for the Python package "ezdxf":

positional arguments:
    pp                  pretty print DXF files as HTML file
    audit               audit and repair DXF files
    draw                draw and convert DXF files by Matplotlib
    view                view DXF files by the PyQt viewer
    browse              browse DXF file structure
    strip               strip comments from DXF files
    config              manage config files

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show version and exit
  -v, --verbose         give more output
  --config CONFIG       path to a config file
  --log LOG             path to a verbose appending log


The ezdxf script is the only executable script installed on the user system, if installed by pip, the dxfpp script is not included anymore.

Pretty Printer

Pretty print the DXF text content as HTML file and open the file in the default web browser:

C:\> ezdxf pp -o gear.dxf

Print help:

C:\> ezdxf pp -h
usage: ezdxf pp [-h] [-o] [-r] [-x] [-l] [-s SECTIONS] FILE [FILE ...]

positional arguments:
  FILE                  DXF files pretty print

optional arguments:
  -h, --help            show this help message and exit
  -o, --open            open generated HTML file by the default web browser
  -r, --raw             raw mode, no DXF structure interpretation
  -x, --nocompile       don't compile points coordinates into single tags (only in raw mode)
  -l, --legacy          legacy mode, reorder DXF point coordinates
  -s SECTIONS, --sections SECTIONS
                        choose sections to include and their order, h=HEADER, c=CLASSES,
                        t=TABLES, b=BLOCKS, e=ENTITIES, o=OBJECTS


Audit and recover the DXF file “gear.dxf” and save the recovered version as “gear.rec.dxf”:

C:\> ezdxf audit -s gear.dxf

auditing file: gear.dxf
No errors found.
Saved recovered file as: gear.rec.dxf

Print help:

C:\> ezdxf audit -h
usage: ezdxf audit [-h] [-s] FILE [FILE ...]

positional arguments:
  FILE        audit DXF files

optional arguments:
  -h, --help  show this help message and exit
  -s, --save  save recovered files with extension ".rec.dxf"


Convert the DXF file “gear.dxf” into a SVG file by the Matplotlib backend:

C:\> ezdxf draw -o gear.svg gear.dxf

The “gear.svg” created by the Matplotlib backend:


Show all output formats supported by the Matplotlib backend on your system. This output may vary:

C:\> ezdxf draw --formats
eps: Encapsulated Postscript
jpg: Joint Photographic Experts Group
jpeg: Joint Photographic Experts Group
pdf: Portable Document Format
pgf: PGF code for LaTeX
png: Portable Network Graphics
ps: Postscript
raw: Raw RGBA bitmap
rgba: Raw RGBA bitmap
svg: Scalable Vector Graphics
svgz: Scalable Vector Graphics
tif: Tagged Image File Format
tiff: Tagged Image File Format

Print help:

C:\> ezdxf draw -h
usage: ezdxf draw [-h] [--formats] [--layout LAYOUT] [--all-layers-visible]
                  [--all-entities-visible] [-o OUT] [--dpi DPI]
                  [--ltype {internal,ezdxf}]

positional arguments:
  FILE                  DXF file to view or convert

optional arguments:
  -h, --help            show this help message and exit
  --formats             show all supported export formats and exit
  --layout LAYOUT       select the layout to draw
  --all-layers-visible  draw all layers including the ones marked as invisible
                        draw all entities including the ones marked as invisible (some
                        entities are individually marked as invisible even if the layer
                        is visible)
  -o OUT, --out OUT     output filename for export
  --dpi DPI             target render resolution, default is 300
  --ltype {internal,ezdxf}
                        select the line type rendering engine, default is internal


View the DXF file “gear.dxf” by the PyQt backend:

C:\> ezdxf view gear.dxf

Print help:

C:\> ezdxf view -h
usage: ezdxf view [-h] [--ltype {internal,ezdxf}] [--lwscale LWSCALE] [FILE]

positional arguments:
  FILE                  DXF file to view

optional arguments:
  -h, --help            show this help message and exit
  --ltype {internal,ezdxf}
                        select the line type rendering engine, default is internal
  --lwscale LWSCALE     set custom line weight scaling, default is 0 to disable line
                        weights at all


Browse the internal structure of a DXF file like a file system:

C:\> ezdxf browse gear.dxf
C:\> ezdxf browse -h
usage: ezdxf browse [-h] [-l LINE] [-g HANDLE] [FILE]

positional arguments:
  FILE                  DXF file to browse

optional arguments:
  -h, --help            show this help message and exit
  -l LINE, --line LINE  go to line number
  -g HANDLE, --handle HANDLE
                        go to entity by HANDLE, HANDLE has to be a hex value without
                        any prefix like 'fefe'

The browse command stores options in the config file, e.g. for the Notepad++ on Windows:


text_editor = "C:\Program Files\Notepad++\notepad++.exe" "{filename}" -n{num}
icon_size = 32

text_editor is a simple format string: text_editor.format(filename="test.dxf", num=100)

Quote commands including spaces and always quote the filename argument!

For gedit on Linux use (untested):


text_editor = gedit +{num} "{filename}"
icon_size = 32

The browse command opens a DXF structure browser to investigate the internals of a DXF file without interpreting the content. The functionality of the DXF browser is similar to the DXF Pretty Printer (pp command), but without the disadvantage of creating giant HTML files. The intended usage is debugging invalid DXF files, which can not be loaded by the ezdxf.readfile() or the ezdxf.recover.readfile() functions.

Line Numbers

The low level tag loader ignores DXF comments (group code 999). If there are comments in the DXF file the line numbers displayed in the DXF browser are not synchronized, use the strip command beforehand to remove all comments from the DXF file in order to keep the line numbers synchronized.

GUI Features

The tree view on the left shows the outline of the DXF file. The number in round brackets on the right side of each item shows the count of structure entities within the structure layer, the value in angle brackets on the left side is the entity handle.

The right list view shows the entity content as DXF tags. Structure tags (data type <ctrl>) are shown in blue, a double click on a reference handle (datatype <ref>) jumps to the referenced entity, reference handles of non-existent targets are shown in red.

Clicking on the first structure tag in the list opens the DXF reference provided by Autodesk in the standard web browser.

Auto Reload

The browser automatically displays a dialog for reloading DXF files if they have been modified by an external application.


Strip comment tags (group code 999) from ASCII DXF files and can remove the THUMBNAILIMAGE section. Binary DXF files are not supported.

C:\> ezdxf strip -h
usage: ezdxf strip [-h] [-b] [-v] FILE [FILE ...]

positional arguments:
  FILE           DXF file to process, wildcards "*" and "?" are supported

optional arguments:
  -h, --help       show this help message and exit
  -b, --backup     make a backup copy with extension ".bak" from the DXF file,
                   overwrites existing backup files
  -t, --thumbnail  strip THUMBNAILIMAGE section
  -v, --verbose    give more output


Manage config files.

C:\> ezdxf config -h
usage: ezdxf config [-h] [-p] [--home] [--reset]

optional arguments:
  -h, --help   show this help message and exit
  -p, --print  print configuration, to store the configuration use:
               "ezdxf config -p > my.ini"
  --home       create config file 'ezdxf.ini' in the user home directory
               '~/.config/ezdxf', $XDG_CONFIG_HOME is supported if set

  --reset      factory reset, delete default config files 'ezdxf.ini'

To create a new config file “my.ini” by printing the configuration into a file:

C:\> ezdxf config -p > my.ini

Show Version & Configuration

Show the ezdxf version and configuration:

C:\> ezdxf -Vv

ezdxf v0.16.5b0 @ d:\source\ezdxf.git\src\ezdxf
Python version: 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)]
using C-extensions: yes
using Matplotlib: yes

default_dimension_text_style = OpenSansCondensed-Light
test_files = D:\Source\dxftest
font_cache_directory =
load_proxy_graphics = true
store_proxy_graphics = true
log_unprocessed_tags = false
filter_invalid_xdata_group_codes = true
write_fixed_meta_data_for_testing = false
disable_c_ext = false

text_editor = "C:\Program Files\Notepad++\notepad++.exe" "{filename}" -n{num}

Environment Variables:

Existing Configuration Files:

See also

Documentation of the ezdxf.options module and the Environment Variables.