Extracts text and embedded images
🤖/document/extract extracts text and embedded images from PDF documents.

Extracts native/selectable text and embedded raster image assets from PDF documents.
For DOCX files, first use /document/convert with format: "pdf", then pass its output to this Robot.
Markdown and HTML output are in beta and aim for readable structure, not a pixel-perfect copy. Native extraction detects paragraphs, larger-font headings, simple lists and aligned tables where possible. Multi-column text can interleave, prose can be mistaken for tables, and merged cells may need adjustment. HTML escapes extracted text and omits source scripts, links and event handlers.
This robot does not render full pages. If you need page images, use /document/thumbs. Vector graphics, charts, and page backgrounds are not always embedded raster images and may therefore not be returned by this robot.
Usage example
Extract native text and embedded raster images from a PDF document:
{
"steps": {
"extracted": {
"extract": [
"text",
"images"
],
"robot": "/document/extract",
"text_method": "native",
"use": ":original"
}
}
}Parameters
interpolateboolean | Record<string, boolean>Controls whether Assembly Variables are interpolated for individual instruction fields.
By default, most Robot instruction fields interpolate Assembly Variables. Set this to
falseto treat every instruction field as literal text, or set an individual field path tofalseto treat only that field as literal text. For Robot-specific fields that are literal by default, set this totrueor set that field path totrueto opt back into interpolation.Use field names such as
path, or dotted paths such asffmpeg.vffor nested objects.output_metaRecord<string, boolean> | boolean | Array<string>Requests CPU-intensive metadata, disabled by default for faster Assemblies.
For images,
"has_transparency": truedetects transparency and"dominant_colors": trueextracts hex colors. Add"dominant_colors_sampled": truefor faster, approximate colors from downscaled frames. Sampling requiresdominant_colorsand changes neither image bytes nor billing. Its method and palette may vary. Omit or disable it for full-resolution colors.For images, you can also add
"blurhash": trueto extract a BlurHash string — a compact representation of a placeholder for the image, useful for showing a blurred preview while the full image loads.For images,
"thumbhash": trueinstead extracts a base64-encoded ThumbHash intometa.thumbhash, together withmeta.has_alpha(whether an alpha channel exists, even when fully opaque). It describes EXIF-oriented pixels and uses the first frame of animated images. Extraction is best-effort: images above 40 megapixels, unsupported formats, or a failed/bounded decode produce no placeholder. Successful extraction adds a metadata charge equivalent to 20% of that file's bytes. No ThumbHash surcharge applies when disabled or when no hash is produced.Set this option on the Step producing the image, such as
/upload/handlefor uploaded originals or/image/resizefor processed outputs. Setting it only on/transloadit/storedoes not request extraction: storage preserves the producer's metadata. Transloadit Storage persists a generated hash with its immutable version and returns it in stored results and native asset reads. Direct S3 uploads do not generate placeholders. A placeholder contains image information, so protect it with the same access controls as the full image.For videos, you can add the
"colorspace": trueparameter to extract the colorspace of the output video.For videos, you can also add
"interlaced": trueto detect whether the video is interlaced. This combines the cheap ffprobefield_orderflag with a boundedidetsampling pass over the first frames of the source, exposinginterlaced,field_order, and a diagnosticinterlace_detectionobject underfile.meta. This is computationally expensive and billed accordingly.For audio, you can add
"mean_volume": trueto get a single value representing the mean average volume of the audio file.You can also set this to
falseto skip metadata extraction and speed up transcoding.user_metaRecord<string, any>(default:{})Adds custom JSON metadata to each emitted file without changing its contents. Nested objects and arrays are supported.
Inheritance depends on the Robot. Values merge with existing
user_metaon the output file; the current Step replaces matching top-level keys. Assign required keys explicitly when a Robot creates fresh outputs.In processing Steps,
${file.*}refers to the first input and${result.*}to the emitted file. Values are evaluated per output after the Robot runs, before subsequent metadata extraction and temporary storage. On:original, values are evaluated per upload before metadata extraction.Downstream Steps read
${file.user_meta.key}. See Custom metadata for a complete example and inheritance rules.resultboolean(default:false)Whether the results of this Step should be present in the Assembly Status JSON
queuebatchSetting the queue to 'batch', manually downgrades the priority of jobs for this step to avoid consuming Priority job slots for jobs that don't need zero queue waiting times
force_acceptboolean(default:false)Force a Robot to accept a file type it would have ignored.
By default, Robots ignore files they are not familiar with. 🤖/video/encode, for example, will happily ignore input images.
With the
force_acceptparameter set totrue, you can force Robots to accept all files thrown at them. This will typically lead to errors and should only be used for debugging or combatting edge cases.ignore_errorsboolean | Array<meta | execute>(default:[])Ignore errors during specific phases of processing.
Setting this to
["meta"]will cause the Robot to ignore errors during metadata extraction.Setting this to
["execute"]will cause the Robot to ignore errors during the main execution phase.Setting this to
trueis equivalent to["meta", "execute"]and will ignore errors in both phases.usestring | Array<string> | Array<object> | objectSpecifies which Step(s) to use as input.
- You can pick any names for Steps except
":original"(reserved for user uploads handled by Transloadit) - You can provide several Steps as input with arrays:
{ "use": [ ":original", "encoded", "resized" ] } - You can also tag input Steps with
asto pass semantic intent to robots:{ "use": [ { "name": ":original", "as": "image" }, { "name": ":original", "as": "mask" } ] }
TipThat's likely all you need to know about
use, but you can view Advanced use cases.- You can pick any names for Steps except
extracttext | images | Array<text | images>(default:["text","images"])Selects which assets to extract. Use
["text"],["images"], or["text", "images"].page_rangestringOptional comma-separated page selection, such as
"1","1-3", or"1,3-5". Page numbers start at 1. Ranges are clamped to the detected page count.At most 1,000 selected pages are allowed per job.
This is supported for native extraction and the self-hosted Docling method. The AWS and GCP OCR methods currently work on the full document.
passwordstringPassword used to unlock encrypted PDFs for native text extraction and embedded image extraction. The other text methods do not support encrypted PDFs.
text_methodnative | ocr | auto | docling(default:"native")Controls how text is extracted.
"native"extracts selectable PDF text locally with Poppler. This is fast, but returns little or no text for scanned PDFs."docling"uses Transloadit’s self-hosted parser for layout, tables, figures, and OCR on scanned regions, including mixed native/scanned documents. No external document-processing service is used. This opt-in method requires an enabled deployment, supports page selection and page granularity, and does not acceptpasswordorocr_provider. Figures are rendered as PNG; original embedded-image encodings and masks are not retained. Recognition and inferred structure can be incorrect."ocr"delegates to/document/ocrand requiresocr_provider."auto"tries native extraction first, then falls back to OCR when no native text is found, or when the native text is unusable because most of its words are spelled as separate letters (s p a c e c r a f t), as in the text layer of some old scans. This also requiresocr_provider.
OCR modes currently cannot be combined with
password.ocr_provideraws | gcpOCR provider to use when
text_methodis"ocr"or"auto". Valid values are"aws"and"gcp".text_formattxt | json | md | html | json_layout(default:"txt")Output format for extracted text. Plain text and JSON retain the existing extraction behavior. Markdown and HTML output are in beta and infer basic structure from native text positions and font sizes.
With
text_method: "docling", all text formats use the self-hosted parser’s reading order and OCR. Itsjson_layoutalso includes page dimensions, block IDs, source labels, top-left-origin bounding boxes in PDF points, and table cells with zero-based offsets and merged-cell spans. HTML preserves spans and Markdown flattens them. Figures are PNG crops referenced by result name. This method accepts up to 64 MiB of input and PDFs containing at most 1,000 pages, including when selecting a page range and fails incomplete conversions. Recognition and inferred structure can be incorrect; confidence scores and field-level citations are not reported."json_layout"returns a JSON file containingschema_version: 1and apagesarray. Each page has its original one-basedpagenumber and ablocksarray. Blockkindis"paragraph"(text),"heading"(text,level),"list"(ordered,start,items),"table"(rows,header) or"image"(name). Text is literal, without Markdown or HTML escaping. Image names match retained extraction results and must be saved alongside the JSON file. Images omitted from rich-text references are also omitted from these blocks. With native extraction, this format uses the same beta layout inference as Markdown and HTML and requirestext_method: "native". Native output does not report bounding boxes, confidence scores or field-level citations. The existing"json"format remains text and page text only.Native Markdown, HTML and
json_layoutextraction limits layout data to 8 MiB per input document, summed across its selected page ranges. For larger documents, use separate extraction Steps with fewer pages in each Step’spage_range.If native extraction cannot confirm the reading order of bidirectional text, it returns a validation error. Try fewer pages or use
text_method: "ocr"with an OCR provider.For native extraction, when
extractincludes images, Markdown and HTML reference retained image results inline using relative, URL-encoded filenames matching each image result’sname. Save the text and image results together to resolve the references. Filtered images have no references; repeated images can reference the same deduplicated result. Images covering the whole page, including page scans, are omitted from references when their visible coverage can be confirmed, while remaining available as image results. This also applies to pages without extracted text; usetext_method: "ocr"with an OCR provider to read scanned text. Images with unavailable or inconsistent positions, including retained image masks, are appended after their page’s text. Embedded base64 images are not produced.When exporting, preserve result names in a shared directory per input document. For example, set
/s3/store’spathto"${assembly.id}/${file.original_id}/${file.name}". Default storage paths using${unique_prefix}/${file.url_name}separate and rename files, so they do not preserve these relative image links.Some native image encodings cannot be displayed by browsers or Markdown viewers. Raw CCITT and JBIG2 image results are not referenced in Markdown or HTML. Set
image_formatto"png"or"jpg"for broadly viewable image results that can be referenced, unless they cover the whole page.OCR Markdown and HTML with
ocr_provider: "aws"infer paragraphs, lists and headings from the positions of the recognized lines and words. Withocr_provider: "gcp", which does not report those positions, they preserve readable text with minimal structure detection. In both cases, extracted images are appended in source order, since OCR does not position them.text_granularitydocument | page(default:"document")Controls text output grouping for native extraction and the self-hosted Docling method.
"document"creates one text result for the selected pages."page"creates one text result per selected page.
Page granularity is supported with
text_method: "native"ortext_method: "docling".keep_page_footersboolean(default:false)Retain recurring footer text, including page numbers, in native Markdown, HTML and
json_layoutoutput, and AWS OCR Markdown and HTML output. By default, recurring text in the bottom 8% of selected pages is omitted when it appears on at least half of the selected pages, with a minimum of two pages. One-off margin text is retained regardless of this setting.With
text_method: "docling", this setting instead retains blocks classified as page headers or footers by the parser, in every text format. This classification can be incorrect and does not require repetition across pages.For native and cloud OCR extraction, this setting does not change plain text, legacy
jsonor extracted image results. GCP OCR and OCR results without usable geometry already retain all recognized text.keep_page_headersboolean(default:false)Retain recurring header text in native Markdown, HTML and
json_layoutoutput, and AWS OCR Markdown and HTML output. By default, recurring text in the top 8% of selected pages is omitted when it appears on at least half of the selected pages, with a minimum of two pages. Enable this when recurring headers contain document IDs or other context you need to retain.With
text_method: "docling", this setting instead retains blocks classified as page headers or footers by the parser, in every text format. This classification can be incorrect and does not require repetition across pages.For native and cloud OCR extraction, this setting does not change plain text, legacy
jsonor extracted image results. GCP OCR and OCR results without usable geometry already retain all recognized text.image_formatauto | original | png | jpg(default:"auto")Output format for extracted embedded raster images. With
text_method: "docling",autoandpngboth return rendered PNG figure crops;originalandjpgare unsupported."auto"and"original"preserve the embedded image format where possible."png"asks Poppler to decode images as PNG."jpg"converts non-JPEG extracted images through/image/resize.
min_image_widthstring | number(default:0)Minimum width in pixels for extracted images. Smaller images are ignored. Set to
0to disable this filter.min_image_heightstring | number(default:0)Minimum height in pixels for extracted images. Smaller images are ignored. Set to
0to disable this filter.min_image_bytesstring | number(default:0)Minimum file size in bytes for extracted images. Smaller images are ignored.
dedupe_imagesboolean(default:true)When enabled, identical extracted image files are emitted only once.
include_image_masksboolean(default:false)When enabled, the robot also keeps image mask files when Poppler exposes them as separate files.