Home

Awesome

<img alt="Logo" src="logo.svg" width=300>

Vector Express - Free Vector Conversion, Analyzing and Processing API

Recent updates

Read more: https://vector.express/pricing

API Frontend: https://vector.express

Vector Express is a free-to-use API for converting, analyzing and processing vector files. Made with love by @vector_express

It runs a combination of different conversion programs that can be chained together to convert between a wide area of formats.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out

Feel free to use it in your project. It does not support CORS, so you need to run it through/on a back-end.

💌 Stay updated

You can sign up to our newsletter here to be informed about new features, upcoming changes and deprecations: https://buttondown.email/vector.express

Table of Contents

📦 <a name="libraries">Libraries</a>

🏃‍♀️ <a name="quickstart">Quickstart</a>

Run in Postman

  1. GET the a compatible conversion path for your input format and desired output format.

curl https://vector.express/api/v2/public/convert/dxf/auto/svg/

  1. POST to the the first path, with your file as the body

curl --data-binary @myvector.dxf https://vector.express/api/v2/public/convert/dxf/cadlib/svg/

  1. GET the file from the resultUrl

curl https://vector.express/api/v2/public/files/[id].svg --output converted.svg

🪄 <a name="convert">Convert</a>

<a name="convert-get-formats">Get possible conversion paths between formats</a>

By requesting the conversion paths you can find out the most efficient path between your formats.

GET https://vector.express/api/v2/public/convert/ext/auto/ext

<a name="convert-file">Convert a file</a>

You can up chain to three programs in the conversion path, and even configure them. See below for all programs and their options.

POST https://vector.express/api/v2/public/convert/ext/prog1/ext/prog2/ext?prog1-opt=val&prog2-opt=val

Available converters

<a name="converter-cad2pdf">/cad2pdf/</a>

A converter for converting dwg and dxf cad files into pdf.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out
OptionTypeDescription 
cad2pdf-auto-fitBooleanAutomatically fit the drawing to to the paper size
cad2pdf-auto-orientationBooleanAutomatically orient the drawing to fit the paper
cad2pdf-centerBooleanCenter the drawing
cad2pdf-point-sizeNumberPoint size in mm
cad2pdf-grayscaleBooleanGrayscale
cad2pdf-landscapeBooleanUse landscape paper
cad2pdf-marginNumberMargin in millimeter
cad2pdf-paper-sizeStringPaper size in the format "WxH"
cad2pdf-scaleNumberScale the drawing
cad2pdf-unitStringOverride the drawing's unit (in/m/mm)

<a name="converter-cad2svg">/cad2svg/</a>

A converter for converting dwg and dxf cad files into svg.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out
OptionTypeDescription 
cad2svg-expand-page-for-stroke-widthBooleanExpand the page to accomodate the stroke width
cad2svg-blockStringExport a specific block
cad2svg-marginNumberMargin
cad2svg-include-bitmapsBooleanInclude bitmaps in the export
cad2svg-layersStringComma delimted list of layers to export
cad2svg-unitStringOverride the drawing's unit (in/m/mm)

<a name="converter-cadlib">/cadlib/</a>

Custom CadLib based converter for AutoCAD files.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out✓ *1

*1 Arcs and curves are converted to lines

OptionTypeDescription 
cadlib-epsilonNumber
cadlib-arc-segmentsNumberLine segment amount on arcs
cadlib-arc-segments-minimumNumberThe minimum amount of segments on arc
cadlib-space-strategyStringWhich ACAD space to prefer for export<br/>prefer_native_space / prefer_paper_space / prefer_model_space

<a name="converter-gs">/gs/</a>

Ghostscript based converter.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out

<a name="converter-hp2xx">/hp2xx/</a>

hp2xx based converter for postscript.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out

<a name="converter-libcdr">/libcdr/</a>

libcdr based converter for CorelDRAW files.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out

<a name="converter-librsvg">/librsvg/</a>

librsvg based converter for converting svg files to various formats.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out

<a name="converter-pdf2svg">/pdf2svg/</a>

pdf2svg based converter for pdf files to svg.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out
OptionTypeDescription 
pdf2svg-pageNumberWhich page to export

<a name="converter-pstoedit">/pstoedit/</a>

pstoedit for converting eps files to dxf.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out
OptionTypeDescription 
pstoedit-pageNumberWhich page to export
pstoedit-xscaleNumberX scale
pstoedit-yscaleNumberY scale
pstoedit-xshiftNumberX shift
pstoedit-yshiftNumberY shift
pstoedit-centeredBooleanCenter drawing
pstoedit-rgbBoolean

<a name="converter-cad">/svg2cad/</a>

For converting svg files into dxf or dwg cad files.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out
OptionTypeDescription 
svg2cad-nojoinBooleanIf enabled, do not join adjacent lines
svg2cad-versionStringWhich AutoCAD version to use<br/>R32 / R27 / R24 / R21 / R18 / R15 / R14

<a name="convertor-svgo">/svgo/</a>

SVGO is an svg optimizer.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out
OptionTypeDescription 
svgo-configStringJSON string of configuration, representing the default export configuration object. This overrides all other configuration parameters if set
svgo-configSvgo2SyntaxBooleanEnable this to use the SVGO 2.0 configuration syntax, otherwise v1 syntax will be used
svgo-enableStringWhich plugins to enable (see SVGO docs)
svgo-disableStringWhich plugins to disable (see SVGO docs)
svgo-indentString
svgo-prettyBooleanPrettify code
svgo-precisionNumberPrecision
svgo-multipassBoolean

<a name="converter-uniconvertor">/uniconvertor/</a>

Uniconvertor based converter for various formats.

Formataicdrdwgdxfepshpglpdfpltpssvg
In
Out

<a name="analyze">🔍 Analyze</a>

<a name="analyze-file">Analyze a file</a>

You can analyze vector files using this endpoint. The result is always a json file. The analyzers can be configured through the query string.

POST https://vector.express/api/v2/public/analyze/ext/analyzer

POST https://vector.express/api/v2/public/analyze/ext/analyzer1?analyzer-opt1=val&analyzer-opt2=val

<a name="available-analyzers">Available analyzers</a>

<a name="analyzer-svg-get-svg-unit">/svg/get-svg-unit/</a>

Gets the unit from an svg document. Also returns an explicit parameter which is true if the unit is explicitly set. (otherwise the unit is px, as per the svg standard)

<a name="analyzer-svg-groups">/svg/groups/</a>

Returns a list of all groups in an svg.

<a name="analyzer-svg-linearmovement">/svg/linearmovement/</a>

Simulates 2D linear movement along all paths in the svg. This can be used for 2D CNC estimation, for example laser cutting, routing, knife cutting and more.

OptionTypeDescription 
linearmovement-jerkNumberAn arbitrary unit setting the amount of jerk in the movement. Higher number = less deceleration around tight corners.
linearmovement-mm-per-sNumberThe speed to move along the paths, in mm/s.
linearmovement-drawing-unitStringWhich unit the SVG is drawn in.<br/>mm / in / pt / px
linearmovement-path-infoBooleanIf enabled, information about individual paths and path segments are included in the outputs.

<a name="process">⚙️ Process</a>

<a name="process-file">Process a file</a>

You can process vector files using this endpoint. The processors can be configured through the query string.

POST https://vector.express/api/v2/public/process/ext/processor

POST https://vector.express/api/v2/public/process/ext/processor?processor-opt1=val&processor-opt2=val

<a name="available-processors">Available processors</a>

<a name="processor-svg-boolean-operation">/svg/boolean-operation/</a>

Performs a boolean operation on target element(s) using tool element(s).

Keep in mind that this will not work on grouped elements and/or non-path elements. Please run the convert-to-path and ungroup processors on the drawing first.

OptionTypeDescription 
boolean-operation-operationStringWhich operation to perform. Default is union.<br/>union / difference / intersection / exclusion / division / cut-path / combine / break-apart
boolean-operation-tool-pathsStringXPath selector* to define the elements to use as the tool. Default is "//svg:path".
boolean-operation-target-pathsStringXPath selector* to define the elements to use as the target. Default is "//svg:path".

* Please note that elements need to be prefixed with svg: to match the SVG namespace. E.g. to select all elements elements with a white-fill style: //svg:path[contains(@style,'#ffffff')

<a name="processor-svg-convert-to-path">/svg/change-attribute/</a>

Allows modification of attributes or inline CSS properties on certain elements. This can be used to set fill, stroke and many other parameters. You can also use an existing attribute value to set the new one. (For example, setting an outline to match the fill of a path)

OptionTypeDescription 
change-attribute-set-attrStringWhich attribute to set. Required.
change-attribute-target-elementsStringWhich set of element types to affect, separated with a comma. Required.
change-attribute-to-valueStringWhat value to set the attribute to.
change-attribute-to-attr-valueStringThis can be set to get the value from another attribute on the same element. If this is set, "to-value" is ignored.
change-attribute-to-attr-value-fallbackStringAn optional fallback to set the attribute to if the attribute from "to-attr-value" has no value.
change-attribute-overrideStringIf this is set, the value will always be set. If used in combination with not setting "to-value" or "to-attr-value", it will remove the attribute.

<a name="processor-svg-convert-to-path">/svg/convert-to-path/</a>

Converts elements (text*, circle, rectangles, etc.) to paths. If your SVG file is exported from Adobe Illustrator, consider running the fix-illustrator-svg-font-names processor first.

OptionTypeDescription 
convert-to-path-selectorStringXPath selector** to define which elements to convert. Default is "//svg:*".

* A selection of open source fonts are compatible. Contact us if you need to convert an unsupported font.<br/> ** Please note that elements need to be prefixed with svg: to match the SVG namespace. E.g. to select all elements with a white-fill style: //svg:path[contains(@style,'#ffffff')

<a name="processor-svg-exclude-groups">/svg/exclude-groups/</a>

Excludes certain groups from an SVG.

OptionTypeDescription 
exclude-groups-groupsStringA list of group ID's to exclude, separated using the NUL syntax (%00)

<a name="processor-svg-flatten-beziers">/svg/flatten-beziers/</a>

Flattens beziers curves into straight lines.

OptionTypeDescription 
flatten-beziers-selectorStringXPath selector* to select which path element's beziers to flatten.

* Please note that elements need to be prefixed with svg: to match the SVG namespace. E.g. to select all elements elements with a white-fill style: //svg:path[contains(@style,'#ffffff')

<a name="processor-svg-fix-illustrator-svg-font-names">/svg/fix-illustrator-svg-font-names/</a>

Attempts a correction of Adobe Illustrator's incorrectly exported font-family tag attribute/CSS property. For example, it will turn font-family="OpenSans-Bold" into font-family="OpenSans" font-weight="bold".

This is required for the convert-to-path processor to work.

<a name="processor-svg-include-only-groups">/svg/include-only-groups/</a>

Includes only certain groups from an SVG.

OptionTypeDescription 
include-only-groups–groupsStringA list of group ID's to include, separated using the NUL syntax (%00)

<a name="processor-svg-ungroup">/svg/ungroup/</a>

Ungroups all elements and nested SVG's recursively. If you require a higher depth than 10, you can make multiple calls.

OptionTypeDescription 
ungroup-depthNumberThe depth to ungroup, 1 - 10. Default is 10.
ungroup-selectorStringXPath selector* to select certain groups or nested SVG's. If this is set, "depth" is ignored

* Please note that elements need to be prefixed with svg: to match the SVG namespace. E.g. to select all elements elements with a white-fill style: //svg:path[contains(@style,'#ffffff')

<a name="processor-svg-xpath">/svg/xpath/</a>

Returns a section of an SVG file using the XPath syntax.

OptionTypeDescription 
xpath-xpathStringThe XPath selector
xpath-text-outputBooleanIf true, the resulting file is a .txt, otherwise it is an .xml file
xpath-add-rootBooleanWhether or not to add the root element

<a name="processor-svg-xslt">/svg/xslt/</a>

Exclude certain elements with XSLT. This can be used to remove unwanted defs, specific elements and more.

OptionTypeDescription 
xslt-exclude-xpathStringThe XPath * syntax selector to exclude from the document.

* Please note that elements need to be prefixed with svg: to match the SVG namespace. E.g. to select all elements elements with a white-fill style: //svg:path[contains(@style,'#ffffff')

📄 <a name="get-file">Get a file</a>

After getting the result you can retrieve your files here.

GET https://vector.express/api/v2/public/files/filename.ext

📨 <a name="using-existing-file">Using an existing file</a>

You can also use an already uploaded or resulting file through the use-file query string.

POST https://vector.express/api/v2/public/convert/ext/prog1/ext/prog2?use-file=filename.ext

🛑 <a name="limits">Limits</a>

Currently the public API is limited to 5 requests per hour, and a maximum output filesize of 1 MiB and certain CPU and memory limitations.

🔼 <a name="increase-limits">Increase limits?</a>

We offer a pay-as-you go plan that removes the rate limit and increases maximum file to 40 MiB.

💡 <a name="feature-request">Feature request?</a>

Get in touch with us and we'll see what we can do!

🙊 <a name="feedback">Feedback</a>

Feel free to open up an issue, or just tweet at us @vector_express.