Home / Blog / Watch

Export ArcGIS Pro Symbols to SVG with Python and Build a Toolbox Tool

A symbol you designed in ArcGIS Pro can become a crisp SVG file in one tool run.

5:36 · Published 2026-10-13

Chapters

  1. 0:00 Why a screenshot of a symbol falls short
  2. 0:21 The logic in four plain steps
  3. 0:41 A style file is a SQLite database
  4. 1:04 Read one symbol with sqlite3 and json
  5. 1:23 Convert CIM marker layers to SVG paths
  6. 1:56 Flip the y axis once per layer
  7. 2:10 Pad the view box, picture and font markers
  8. 2:28 Write a PNG with cairosvg or Inkscape
  9. 2:44 The same code as a Python toolbox
  10. 3:10 Get parameter info builds the dialog
  11. 3:47 Update parameters and execute
  12. 4:09 Run the tool in ArcGIS Pro
  13. 4:47 The SVG files on a web map
  14. 4:58 Recap

Transcript

Why a screenshot of a symbol falls short (0:00)

A symbol you designed in ArcGIS Pro can become a crisp SVG file in one tool run. A screenshot of a symbol is blurry at any other size. The symbol itself is already stored as data.

The logic in four plain steps (0:21)

The logic comes first, in four plain steps. Then the same code becomes a tool in ArcGIS Pro. Step one opens the style file. Step two lists its symbols. Step three turns each symbol into SVG. Step four writes a PNG, if you want one.

A style file is a SQLite database (0:41)

A style file, with the extension stylx, is a SQLite database. Its ITEMS table has one row per symbol: name, category, class and content. The content column holds the symbol as CIM JSON. CIM is the Cartographic Information Model, Esri's JSON description of maps and symbols.

Read one symbol with sqlite3 and json (1:04)

So the Python standard library is enough. sqlite3 opens the file, and json reads the symbol. Step two is two small queries. List categories returns the distinct category names. List names returns the symbol names, filtered by category when you ask.

Convert CIM marker layers to SVG paths (1:23)

Step three is the converter. A point symbol is a stack of marker layers. Each vector marker layer holds graphics: a geometry, plus the fill and stroke that paint it. Rings and paths become an SVG path. Straight segments become line commands. Curves become C and Q commands, and true arcs become A commands. Solid fill and stroke colors carry over.

CIM alpha runs from zero to one hundred, and SVG opacity from zero to one.

Flip the y axis once per layer (1:56)

One detail matters here. CIM geometry counts y upward, and SVG counts y downward. So each layer gets one group transform with a negative y scale, instead of flipping every point.

Pad the view box, picture and font markers (2:10)

The view box is padded by half the widest stroke, so thick outlines are not clipped. Picture markers are decoded from their embedded image and linked from the SVG. Font-based character markers are skipped. This tool is for point symbols built from vector or picture markers.

Write a PNG with cairosvg or Inkscape (2:28)

Step four rasterizes the SVG it just wrote. It uses cairosvg if it is installed, and Inkscape if not. Without either one, the SVG files are still written, and the PNG step is skipped with a note.

The same code as a Python toolbox (2:44)

Now the same code becomes a tool in ArcGIS Pro. The notebook and the Python toolbox share one function, export symbols. The toolbox adds a thin wrapper around that function. Only the wrapper calls arcpy. A Python toolbox is a file with the extension pyt. It defines a toolbox class and one class per tool. Three methods do the work.

Get parameter info builds the dialog (3:10)

Get parameter info returns the parameters, and ArcGIS Pro draws the tool dialog from them. Each value in the notebook's CONFIG cell becomes one parameter. The style path becomes a file parameter, filtered to stylx files. Scope becomes a value list: all symbols, selected categories, or a single symbol. The output folders become folder parameters. Write PNG becomes a check box, and target size a long integer.

A ninth parameter is derived. It returns the result summary after the run.

Update parameters and execute (3:47)

Update parameters runs while the dialog is open. It turns on the categories box only for selected categories, and fills it from the style file. Execute runs when you click Run. It reads the parameter values and calls export symbols. Each line the converter prints goes straight to the geoprocessing messages.

Run the tool in ArcGIS Pro (4:09)

In ArcGIS Pro, the toolbox sits under Toolboxes in the Catalog pane. Open the tool, and the dialog shows the parameters from get parameter info. Leave the style blank, and the tool looks for your Favorites style. Here it points to a demo style. Switch the scope to selected categories. The categories list fills from the style file. Pick two categories and an output folder, then run.

The messages list every symbol, and the summary reports the count exported. The output folder now holds one SVG and one PNG per symbol.

The SVG files on a web map (4:47)

Those SVG files drop straight into a web map. Here, the ArcGIS Maps SDK for JavaScript draws each one as a picture marker symbol.

Recap (4:58)

The three details, in short: a style file is SQLite, a symbol is CIM JSON, and a Python toolbox is a thin wrapper over the same code. The notebook and the Python toolbox are on the All Things Spatial blog post for this workflow. Built by All Things Spatial.

Related

Want this built for your team?

We build the ArcGIS tools, notebooks and web apps shown in these videos for real organizations. Tell us what you need to automate or map.

Book an intro call