ONLYOFFICE Docs icon

ONLYOFFICE Docs

Consume ONLYOFFICE Document Server API (Conversion, Document Builder)

Conversion → Generate Thumbnail

AI-generated

Summary

Generate a JPG or PNG thumbnail from a document URL or an input binary field. Set the input format and thumbnail size, aspect handling, and whether to render only the first page; choose whether to return the file as binary data or a URL.

Inputs

  • File Source (required) — Choose URL (default) so the ONLYOFFICE Document Server downloads the file from File URL, or Binary Input to upload a file from the selected binary field.
  • File URL (required) — Source document URL; shown when File Source is URL.
  • Input Binary Field (required) — Name of the incoming binary field containing the source document; defaults to data and is shown for Binary Input.
  • Input Format Name or ID (required) — Format of the source document, such as docx. The available formats depend on the selected operation.
  • Image Format (required) — Thumbnail image format: JPG or PNG (default).
  • Width — Thumbnail width in pixels (default 100).
  • Height — Thumbnail height in pixels (default 100).
  • Aspect Ratio — How to handle a mismatch between the thumbnail dimensions and document page: Crop, Fit (default), or Stretch.
  • First Page Only — Generate one image for the first page (default), or a ZIP archive with images for all pages.
  • Output Mode — Return File Data as binary (default) or URL Only without downloading the result.
  • Output File Name — Output filename without extension when returning File Data; defaults to converted.
  • Put Output File in Field — Binary field name for the returned file when using File Data; defaults to data.

Output shape

One output item per input item, containing either binary thumbnail data or a URL.

With File Data, the output item includes success, fileName, inputFormat, outputFormat, and operation in JSON, plus the file in the configured binary field. The extension is JPG or PNG when First Page Only is enabled and ZIP when disabled. With URL Only, the JSON includes success, convertedUrl, inputFormat, outputFormat, and operation; the output file is not downloaded.

Links

Discussion