Skip to main content
All parameters for POST /api/v1/generate and POST /api/v1/preview.
All pixel values (margins, font sizes, spacing) are specified at 300 DPI baseline. When using dpi: 600, the API automatically scales them to maintain physical dimensions.

Required parameters

ParameterTypeDescription
textstringText to render. 1-10,000 characters. Use \n for line breaks, \n\n for paragraphs.

Content parameters

ParameterTypeDefaultRangeDescription
font_idinteger11-90Font identifier. See fonts guide.
font_sizeint or "auto""auto"12-400Font size in pixels, or "auto" for automatic sizing.
max_auto_font_sizeinteger20020-400Maximum size when using auto-fit. Prevents oversized text on short content.
generation_typestring"standard""standard" or "address". Address mode has constraints (see below).

Page layout

ParameterTypeDefaultRangeDescription
page_sizestring"a4"Page format. See page sizes guide.
orientationstring"portrait""portrait" or "landscape".
dpiinteger300300, 600Output resolution.
margin_leftinteger2400-5000Left margin in pixels (~20mm at 300 DPI).
margin_rightinteger2400-5000Right margin in pixels.
margin_topinteger2400-5000Top margin in pixels.
margin_bottominteger2400-5000Bottom margin in pixels.

Text styling

ParameterTypeDefaultRangeDescription
text_alignmentstring"left""left" or "center".
text_colorarraynull0-255 eachRGB color as [R, G, B] (defaults to black if omitted).
kerningbooleantrueEnable letter pair kerning for natural spacing.
line_height_multiplierfloat2.00.5-4.0Line height as multiplier of font size.
line_break_spacingintegerauto0-500Extra spacing between paragraphs (after \n\n).
word_spacinginteger00-3000Extra pixels between words.

Natural effects

All effects are disabled by default. Enable each with its boolean flag.

Word rotation

ParameterTypeDefaultRangeDescription
enable_word_rotationbooleanfalseEnable slight word angle variations.
word_rotation_rangefloat5.00-10Maximum rotation angle in degrees.

Natural variation

Elastic deformation that makes letters less uniform.
ParameterTypeDefaultRangeDescription
enable_natural_variationbooleanfalseEnable letter displacement effect.
natural_variation_alphainteger150-100Deformation intensity. 10-40 typical.
natural_variation_sigmainteger50-10Deformation smoothness. Use ≥3 with high alpha.

Random indentation

ParameterTypeDefaultRangeDescription
enable_random_indentationbooleanfalseEnable random line start variation.
indentation_rangeinteger200-100Maximum indentation in pixels.

Ink flow

Simulates ink fading/running out.
ParameterTypeDefaultRangeDescription
enable_ink_flowbooleanfalseEnable ink fade effect.
ink_flow_intensityfloat1.00-3.0Fade intensity.

Output options

ParameterTypeDefaultDescription
output_formatstring"png""png" (JSON with base64) or "pdf" (binary response).
pdfobjectPDF options (only when output_format: "pdf"). See PDF guide.

PDF options

Only applies when output_format: "pdf".
ParameterTypeDefaultDescription
pdf.presetstring"generic""generic", "lob", "click2mail".
pdf.standardstring"pdf""pdf" (RGB) or "pdfx1a" (CMYK).
pdf.icc_profilestring"auto"ICC profile for PDF/X-1a.
pdf.profilestring"document""document", "press", "auto".
pdf.regionstring"auto""us", "eu", "auto".
pdf.bleed_mmfloatautoBleed in mm (0-20).
pdf.crop_boxstring"media""media", "bleed", "trim".

Address mode constraints

When generation_type: "address":
ConstraintLimit
Maximum lines5
Maximum characters250
Font sizingManual only (no "auto")
Example:
{
  "text": "John Smith\n123 Main Street\nAnytown, ST 12345",
  "generation_type": "address",
  "font_size": 48,
  "page_size": "envelope_10"
}

DPI scaling

All pixel values are at 300 DPI baseline. At 600 DPI:
300 DPI600 DPIPhysical
240px480px~20mm
100px200px~8.5mm
1200px2400px~102mm
You don’t need to change values when switching DPI — the API scales automatically.

Complete example

{
  "text": "Dear valued customer,\n\nThank you for your order!",
  "font_id": 3,
  "font_size": "auto",
  "max_auto_font_size": 150,
  "page_size": "card_5x7",
  "orientation": "portrait",
  "dpi": 300,
  "margin_left": 180,
  "margin_right": 180,
  "margin_top": 200,
  "margin_bottom": 200,
  "text_alignment": "left",
  "text_color": [20, 20, 80],
  "kerning": true,
  "line_height_multiplier": 2.2,
  "enable_word_rotation": true,
  "word_rotation_range": 3.0,
  "enable_natural_variation": true,
  "natural_variation_alpha": 20,
  "natural_variation_sigma": 5,
  "output_format": "png"
}