Skip to main content

Shared Types

Type definitions used across multiple API endpoints.

Region object

Pixel coordinates defining a rectangular area within an image or page.

top_left_x integer

X coordinate of the top-left corner (pixels)

top_left_y integer

Y coordinate of the top-left corner (pixels)

width integer

Width of the region (pixels)

height integer

Height of the region (pixels)

Callback object

post string

URL to post results to. Must be a string

reply object (optional)

Object merged into the callback response body. Must be an object, cannot contain batch_id

body object (optional)

Additional data included when posting results

headers object (optional)

HTTP headers to include when posting results

Invalid callback configuration returns error opts_bad_callback.

DetectedAlphabet object

Each field is a boolean that is true if any characters from that alphabet are recognized in the image, regardless of whether the result fields contain those characters.

  • en — English
  • hi — Hindi Devanagari
  • zh — Chinese
  • ja — Kana Hiragana or Katakana
  • ko — Hangul Jamo
  • ru — Russian
  • th — Thai
  • ta — Tamil
  • te — Telugu
  • gu — Gujarati
  • bn — Bengali
  • vi — Vietnamese

AlphabetsAllowed object

A map from alphabet key to boolean that controls which alphabets are allowed in the output. This is useful when different alphabets contain look-alike characters (e.g. Latin B vs Cyrillic В) that can cause incorrect Unicode encodings in the result.

  • Keys correspond to the alphabet codes listed in DetectedAlphabet (e.g. hi, ru)
  • By default all alphabets are allowed
  • Set a key to false to suppress that alphabet in the output
  • Setting a key to true has the same effect as omitting it

AlphabetsAllowed example

{"alphabets_allowed": {"ru": false, "hi": false}}

ConversionStatus object

A map from format name to its conversion state. Each key is a format name (e.g. docx, pdf) and the value is an object with the following fields:

status string

One of processing, completed, or error.

error_info ErrorInfo (optional)

Present when status is error. Contains id (error identifier) and error (human-readable message).

ConversionStatus example

{
"docx": {"status": "completed"},
"pdf": {"status": "error", "error_info": {"id": "conversion_error", "error": "..."}}
}

Conversion Formats

info

This parameter is called formats for v3/converter and conversion_formats for v3/pdf.

FormatDescription
mdPlain Markdown
docxMicrosoft Word document
tex.zipLaTeX zip with images
htmlHTML file
pdfPDF with HTML rendering
latex.pdfPDF with LaTeX rendering
pptxPowerPoint presentation
mmd.zipMathpix Markdown zip with images
md.zipMarkdown zip with images
html.zipHTML zip with images

Conversion Options

Specifies options for specific output formats. Each key corresponds to a format enabled in formats, and the associated object contains format-specific settings.

Conversion options for docx

font string (optional), default value is Georgia

Specifies the name of the font that will be used in the document.

fontSize integer (optional), default value is 22

Specifies the font size in half-points (e.g. 22 = 11pt).

language string (optional), default value is auto

Specifies the document language for spelling and grammar checking. When auto, the language is detected automatically. See supported values below.

orientation string (optional), default value is portrait

Specifies the page orientation portrait or landscape.

margins object (optional)

Specifies page margins. All values are in twips (1 twip = 1/20 of a point).

FieldTypeDefaultDescription
topinteger1440Top margin
rightinteger1800Right margin
bottominteger1440Bottom margin
leftinteger1800Left margin
gutterinteger (optional)0Extra space for binding
htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Supported language values: auto, Afrikaans, Arabic, Basque (Basque), Bosnian, Bulgarian, Catalan, Chinese (China), Chinese (Taiwan), Croatian, Czech, Danish, Dutch, English (AUS), English (CAN), English (UK), English (US), Estonian, Finnish, French, French (Canada), French (Switzerland), Galician, Georgian,German, German (Austria), German (Switzerland), Greek, Gujarati, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Irish, isiXhosa, isiZulu, Italian, Japanese, Kannada, Kazakh, Kiswahili, Korean, Latvian, Lithuanian, Macedonian, Malaysian, Marathi, Norwegian Borkmal, Norwegian Nynorsk, Persian, Polish, Portuguese, Portuguese (Brazil), Romanian, Russian, Serbian (Cyrillic), Serbian (Latin), Sesotho Sa Leboa, Setswana, Slovak, Slovenian, Spanish, Spanish (Traditional Sort), Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Welsh.

Conversion options for tex.zip

fontSize string (optional), default value is 10pt

Specifies the font size as a LaTeX size string. Numeric values are treated as pt.

Values

10pt, 11pt, 12pt

font string (optional), default value is CMU Serif

Specifies the name of the font that will be used in the document. Used only for XeLaTeX1.

Values

CMU Serif, Open Sans, Crimson Text, Arimo, Noto Sans, Noto Serif

imagesFolder string (optional), default value is images

Specifies the folder name for images.

load_external_fonts bool (optional), default value is false

Specifies that all used fonts should be included in the tex.zip. Used only for XeLaTeX1.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

warning

Note: The XeLaTeX compiler will be used if the document contains text in languages such as Bengali, Gujarati, Hindi, Hebrew, Tamil, Thai, Arabic, Japanese, Korean, Traditional Chinese, or Simplified Chinese.

Conversion options for html

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for md

math_inline_delimiters [string, string] (optional), default value is ["$", "$"]

Specifies begin inline math and end inline math delimiters.

math_display_delimiters [string, string] (optional), default value is ["$$", "$$"]

Specifies begin display math and end display math delimiters.

escape_ampersand bool (optional), default value is true

Specifies whether to escape the & character in the source content.

escape_dollar bool (optional), default value is true

Specifies whether to escape the $ character in the source content.

escape_hash bool (optional), default value is true

Specifies whether to escape the # character in the source content.

escape_percent bool (optional), default value is false

Specifies whether to escape the % character in the source content.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for latex.pdf

fontSize string (optional), default value is 10pt

Specifies the font size as a LaTeX size string. Numeric values are treated as pt.

Values

10pt, 11pt, 12pt

font string (optional), default value is CMU Serif

Specifies the name of the font that will be used in the document. Used only for XeLaTeX2.

Values

CMU Serif, Open Sans, Crimson Text, Arimo, Noto Sans, Noto Serif

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

warning

Note: The XeLaTeX compiler will be used if the document contains text in languages such as Bengali, Gujarati, Hindi, Hebrew, Tamil, Thai, Arabic, Japanese, Korean, Traditional Chinese, or Simplified Chinese.

Conversion options for pdf

fontSize integer (optional), default value is 17

Specifies the font size in px. Clamped to the range 8–128.

text_color string (optional), default value is #1E2029

Specifies the text color, can be name, hex, or rgb.

background_color string (optional), default value is not set

Specifies the background color, can be name, hex, or rgb.

disable_footer bool (optional), default value is false

Enable or disable footer such as page numbers.

margin integer (optional), default value is 70

Specifies the margin size. Minimum value is 40, maximum is 200.

custom_css string (optional), default value is not set

Specifies custom CSS styles to be applied to the document.

footnote_compact_refs bool (optional), default value is false

Specifies the option to hide repeat indexes for Markdown footnotes.

resource_load_timeout_sec number (optional), default value is 60

Specifies the timeout in seconds (can be fractional) for loading external resources (such as images or fonts). If a resource does not load within this time, it will be excluded from the output. Must be greater than zero.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for pptx

fontSize integer (optional), default value is 16

Specifies the font size in px.

text_color string (optional), default value is #000000

Specifies the text color, can be name, hex, or rgb.

background_color string (optional), default value is not set

Specifies the background color, can be name, hex, or rgb.

margin integer (optional), default value is 48

Specifies the margin size in px.

custom_css string (optional), default value is not set

Specifies custom CSS styles to be applied to the document.

footnote_compact_refs bool (optional), default value is false

Specifies the option to hide repeat indexes for Markdown footnotes.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for md.zip

math_inline_delimiters [string, string] (optional), default value is ["$", "$"]

Specifies begin inline math and end inline math delimiters.

math_display_delimiters [string, string] (optional), default value is ["$$", "$$"]

Specifies begin display math and end display math delimiters.

escape_ampersand bool (optional), default value is true

Specifies whether to escape the & character in the source content.

escape_dollar bool (optional), default value is true

Specifies whether to escape the $ character in the source content.

escape_hash bool (optional), default value is true

Specifies whether to escape the # character in the source content.

escape_percent bool (optional), default value is false

Specifies whether to escape the % character in the source content.

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Conversion options for html.zip

htmlTags bool (optional), default value is true

Enables or disables support for HTML tags in the source content.

Footnotes

  1. See XeLaTeX note below. 2

  2. See XeLaTeX note below.