GotenbergFileConverter
Route local files, typed byte streams, and HTTP(S) URLs to Gotenberg and return ordered PDF ByteStream objects. Gotenberg handles LibreOffice, Chromium HTML, Chromium Markdown, and URL-to-PDF conversion; this component picks the route from each source.
Key Features
- Converts Office documents and many other local file types through Gotenberg's LibreOffice route.
- Converts HTML, Markdown, and web URLs through Gotenberg's Chromium routes.
- Accepts file paths,
Pathobjects,ByteStreaminputs, and URL strings in one batch. - Supports synchronous and asynchronous execution with a configurable async concurrency limit.
- Optional
resourcesfor HTML and Markdown conversion (CSS, images, and similar assets).
Configuration
- Run a Gotenberg instance reachable from your pipeline (for example
http://localhost:3000). See the Gotenberg documentation. - Add
GotenbergFileConverterto your pipeline and seturlto your Gotenberg base URL. - Connect the pipeline file input to
sourcesand wireoutputto a downstream converter such asPyPDFToDocumentif you need HaystackDocumentobjects.
Connections
GotenbergFileConverter accepts sources (and optional resources at run time) and returns output, a list of PDF ByteStream objects in input order. Connect output to document converters or file writers downstream.
Source Code
To check this component's source code, open converter.py in the Haystack Core Integrations repository.
Usage Examples
Basic Configuration
gotenberg_converter:
type: haystack_integrations.components.converters.gotenberg.converter.GotenbergFileConverter
init_parameters:
url: http://localhost:3000
timeout: 30.0
concurrency_limit: 5
Using the Component in a Pipeline
# haystack-pipeline
components:
gotenberg_converter:
type: haystack_integrations.components.converters.gotenberg.converter.GotenbergFileConverter
init_parameters:
url: http://localhost:3000
pdf_converter:
type: haystack.components.converters.pypdf.PyPDFToDocument
init_parameters: {}
connections:
- sender: gotenberg_converter.output
receiver: pdf_converter.sources
inputs:
files:
- gotenberg_converter.sources
max_runs_per_component: 100
metadata: {}
Parameters
Init Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | str | http://localhost:3000 | Base URL of the Gotenberg service (HTTP or HTTPS). |
timeout | float | 30.0 | Request timeout in seconds. |
concurrency_limit | int | 5 | Maximum concurrent Gotenberg requests during run_async. Synchronous run converts one source at a time. |
Related Information
Was this page helpful?