Conversion Options
Every POST /v1/convert job can take an options object that tunes how the PDFFLY engine produces your output. This page explains how options work and lists every supported option, grouped by the output format(s) it affects.
How options work
options is a JSON object of key/value overrides, passed in the options form field of a /v1/convert request. Each key is one engine setting; values are strings or numbers.- Your options are layered on top of the engine defaults and the chosen format's presets — you only set what you want to change.
- Use the option names in the tables below (these are the names
GET /v1/formats reports). Several friendly aliases are also accepted (e.g. dpi for tiff_dpi, dxf_version for dxf_appl) — noted per option. - Unknown keys are refused with
400 invalid_options: the item names the option and, when a known option is close, gives it as did_you_mean. Match the names exactly. - Options that don't apply to your
output_format are ignored (e.g. dxf_layers on a PNG job). - Every value must fit inside one engine setting (since v2.15.3). Leading and trailing spaces and line breaks are trimmed. A value is then refused with
400 invalid_options if it contains a control character or a line break, an unmatched double quote, /*, or a parenthesis outside double quotes. Any other text is accepted, including non-ASCII font names. Details and the error body: API Reference, POST /v1/convert.
Worked example
Convert to DWG with a specific AutoCAD version and PDF-layer mapping:
curl -X POST https://api.visual-integrity.com/v1/convert \
-H "Authorization: Bearer vi_your_api_key" \
-F "file=@drawing.pdf" \
-F "output_format=dwg" \
-F 'options={"dxf_appl":"autocad2004","dxf_layers":"DXF_PDFLAYERS","chars2paths":"1"}'
AutoCAD version: dxf_appl accepts only autocad2004, autocad2000, or cadra. Any other value (e.g. autocad2018) is automatically treated as autocad2004 — it does not error, but it also does not give you a newer format.
Reading the tables
Each option lists the format(s) it applies to, its type/accepted values, its default, and what it does. Defaults are the values the API advertises; a format's own presets may set a different effective default.
General — all formats
| Option | Type / values | Default | Description |
|---|
insert_as | ANCHOR | PAGE | ANCHOR | ANCHOR = drawing bounding box; PAGE = full page dimensions |
page_size | AUTOMATIC | LETTER | A4 | CUSTOM | AUTOMATIC | Output page size. CUSTOM also needs page_width + page_height |
rotate | 0 | 90 | 180 | 270 | 0 | Rotate output by degrees (alias: rotation) |
hflip | 0 | 1 | 0 | Flip horizontally |
vflip | 0 | 1 | 0 | Flip vertically |
page_range | string, e.g. 1, 1-3, 1,3,5-7 | all | Pages to convert; blank = all |
bboxmargin | number 0–50 (mm) | 0 | Extra whitespace margin around the drawing (alias: bbox_margin) |
clipping | 0 | 1 | 1 | Respect PDF clipping commands |
ignore_pathobjects | 0 | 1 | 0 | Drop path/vector objects (alias: ignore_paths) |
ignore_textobjects | 0 | 1 | 0 | Drop text objects (alias: ignore_text) |
ignore_imageobjects | 0 | 1 | 0 | Drop embedded image objects (alias: ignore_images) |
Text & line rendering — vector formats (DWG, DXF, SVG, EMF, WMF, CGM, EPS, PS)
| Option | Type / values | Default | Description |
|---|
chars2string | 1 | 2 | 3 | 2 | Combine glyphs into strings (alias: chars_to_string) |
chars2paths | 0 | 1 | 2 | 0 | Render characters as Bézier curves (alias: chars_to_paths) |
scaletext | number 0.1–10 | 1.0 | Scale text-string height (alias: scale_text) |
font_warnings | 0 | 1 | 1 | Show missing-font warnings (0 = suppress) |
min_linewidth | number 0–10 (mm) | 0 | Minimum line width per vector object (also applies to HPGL) |
linestyle | 0 | 1 | 1 | 1 = use line-style attributes; 0 = render as segments for exact WYSIWYG |
CAD — DWG & DXF
| Option | Type / values | Default | Description |
|---|
dxf_appl | autocad2004 | autocad2000 | cadra | autocad2004 | Target CAD version (alias: dxf_version; other values clamp to autocad2004) |
dxf_layers | DXF_PDFLAYERS | DXF_COLORLAYERS | DXF_LINEWLAYERS | DXF_ATTRLAYERS | DXF_ADVCOLORLAYERS | DXF_PDFLAYERS | How objects map to DXF layers |
dxf_unittype | 0 | 1 | 1 | 0 = inch, 1 = mm (alias: dxf_unit_type) |
multipagedxf | SINGLE | MERGE | ADDH | ADDV | LAYER | SINGLE | Multipage handling (alias: dxf_multipage) |
dxf_fit | 0 | 1 | 1 | Ensure the drawing is fully visible when opened in CAD |
hidden_text | 0 | 1 | 2 | 3 | 0 | Hidden text: 0=ignore, 1=include, 2=render white, 3=transparent (alias: dxf_hidden_text) |
zero_linewidth | 0 | 1 | 0 | Set all line weights to 0 |
dxf_whitefill | 0 | 1 | 0 | Ignore white-filled objects (alias: dxf_white_fill) |
dxf_path2poly | 0 | 1 | 0 | Represent paths as polylines/polygons (alias: dxf_path_to_poly) |
dxf_compoundpaths | 0 | 1 | 1 | Convert compound paths as single objects (alias: dxf_compound_paths) |
dxf_custls | 0 | 1 | 0 | Map PDF line styles to custom DXF line styles (alias: dxf_custom_linestyles) |
pathto | 0 | 1 | 1 | Recognize circles/ellipses from closed polygons. Boolean wrapper — the API takes 0/1; internally 1 → the engine's PATH2ELLIPSE (on), 0 → PATH2PATH (off). Pass 0/1, not the raw engine strings (alias: path_to) |
dashlines | 0 | 1 | 0 | Recognize dashed H/V lines as one styled object (alias: dash_lines) |
dxf_imagetransparency | 0 | 1 | 2 | 0 | 0=off, 1=b&w images transparent, 2=all images transparent (alias: dxf_image_transparency) |
dxf_softmask | 0 | 1 | 0 | Convert 8-bit-softmask images to PNG with alpha |
Raster images — PNG, TIFF, JPG, BMP, GIF
| Option | Applies to | Type / values | Default | Description |
|---|
tiff_dpi | all raster | number 72–1200 | 150 | Output resolution in DPI (aliases: dpi, resolution) |
image_fit_width | all raster | number 0–10000 (px) | 0 | Scale to this width; 0 = use DPI. Aspect preserved |
image_fit_height | all raster | number 0–10000 (px) | 0 | Scale to this height; 0 = use DPI |
tiff_bpp | TIF, BMP, GIF, PNG | truecolor | colormap | b&w | colormap | Color depth (24 / 8 / 1-bit) |
image_quality | all raster | SMOOTH | BASIC | SMOOTH | SMOOTH = antialiased; BASIC = none |
image_quality_factor | JPG only | number 1–100 | 100 | JPEG quality; lower = smaller file (alias: jpeg_quality) |
multipagetiff | TIF only | 0 | 1 | 0 | Combine all pages into one multipage TIFF (alias: tiff_multipage) |
tiff_cmyk | TIF only | 0 | 1 | 0 | Output CMYK TIFF instead of RGB |
jpg_cmyk | JPG only | 0 | 1 | 0 | Output CMYK JPEG instead of RGB |
image_pdfcrop | all raster | 0 | 1 | 0 | Trim white space around the image (computes bounding box) (alias: image_pdf_crop) |
gif_transparency | GIF only | 0 | 1 | 0 | Transparent GIF background |
SVG
| Option | Type / values | Default | Description |
|---|
svg_appl | ADOBE | FOP | ADOBE | Optimize for Adobe SVG Viewer or Apache Batik/FOP (alias: svg_application) |
svg_raster | INCLUDED | REFERENCED | INCLUDED | Embed raster in the SVG, or reference external .jpg files |
embed_font | 0 | 1 | 0 | Embed fonts in the SVG |
svg_kerning | 0 | 2 | 0 | 2 = use tspan for character positioning |
viewport_scale | number 1–1000 (%) | 100 | Scale SVG output by percent (aliases: scale, svg_viewport) |
EMF / WMF
| Option | Type / values | Default | Description |
|---|
emf_kerning | 0 | 1 | 2 | 0 | 0 = none, 1 = character widths, 2 = position-based |
donotflip | 0 | 1 | 0 | Set 1 only if embedded images appear flipped (alias: emf_do_not_flip) |
dither | 0 | 1 | 1 | Dither color images to 256-color (alias: emf_dither) |
EPS
| Option | Type / values | Default | Description |
|---|
eps_fittopage | 0 | 1 | 0 | Scale EPS output to LETTER page size (alias: eps_fit_to_page) |
eps_cmyk | 0 | 1 | 0 | Use the CMYK color model |
CGM
| Option | Type / values | Default | Description |
|---|
cgmlevel | 1 | 2 | 3 | 4 | 1 | CGM specification level |
cgm_appl | ATA | NONE | ATA | ATA iSpec 2200 profile, or generic CGM |
cgm_metric | 0 | 1 | 0 | Enable metric scaling |
HPGL
| Option | Type / values | Default | Description |
|---|
hpgl_plot_unit | number 1–1000 | 40 | HPGL plot-unit value |
Text — TXT
| Option | Type / values | Default | Description |
|---|
doc_type | FORM | DOC | FORM | FORM = preserve spatial layout; DOC = flowing text document |
ascii_format | ISO8859 | UTF8 (also accepted as UTF-8) | UNICODE | ISO8859 | Output text encoding. UTF8 writes UTF-8 but keeps the same character substitutions as ISO8859 (for example typographic quotes become straight ones, a Symbol-font μ becomes m, and on some files even a micro sign µ in Helvetica does). UNICODE keeps the characters and writes UTF-8 without a byte-order mark (before v2.17.0: UTF-16 with a byte-order mark). Any other value is refused with 400 invalid_options |
decr_pointsize | number 0–20 | 0 | Decrease all font sizes by x pts — helps column integrity in tables |
abs_pointsize | number 0–72 | 0 | Force an absolute point size (0 = keep original) |
kerning | number −10–10 (mm) | 0 | Decrease character width by this value |
leading | number −20–20 (pts) | 0 | Add to the baseline spacing between lines |
basedelta | number 0–20 (mm) | 0 | Merge strings onto one line when their baseline delta is below this |
autorotation | 0 | 1 | 0 | Auto-rotate landscape pages for better text extraction |
Notes & caveats
- General options and raster/text output: the engine advertises the General options (
rotate, hflip, page_size, insert_as, etc.) as applying to all formats including raster and TXT. Their visual effect on raster output is well-exercised; effect on TXT output for the geometry-oriented ones (insert_as, page_size) is less commonly used — test if you rely on it. - CGM and HPGL options are exposed but see less production use than the CAD/vector/raster paths; verify output for your specific use case.
- Advanced engine options: the engine accepts additional low-level options beyond this list (passed through verbatim). They are undocumented, unvalidated, and unsupported — use the options above.