# Marqius Kern's OpenAPI document, made from Marqius Kern's route and field tables (src/kern/spec.rs)
# by `marqius-kern openapi`. Do not edit it by hand: change the tables, then make it again.
openapi: "3.1.0"
info:
  title: Marqius Kern
  version: "8.40.0"
  summary: Gotenberg-compatible document conversion on the marqius engine
  description: |-
    Marqius Kern converts documents to PDF and works on PDFs, answering Gotenberg's API: 8.40.0's, and 9.10.3's beside it on the same server.

    ## Getting started

    Marqius Kern listens on port 3000. If you are reading this from a running server, it is ready: every operation's samples call `http://localhost:3000` (put your server's address in its place). They are POSIX shell (macOS, Linux, WSL) and make their own inputs, so each one runs as printed.

    Your first PDF:

        printf '<!doctype html><html><body><h1>Hello</h1></body></html>' > index.html
        curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o hello.pdf

    With no server at hand, `marqius-kern run` answers one request the same way, taking curl's form flags as they are:

        marqius-kern run /forms/chromium/convert/html -F files=@index.html -o hello.pdf

    ## What comes back

    A file (a PDF, a picture, several as a ZIP) or JSON, with 200. A request that cannot be answered gets 4xx or 5xx and a plain-text message, in Gotenberg's words. Every answer carries the `Gotenberg-Trace` header, which finds the request in the server's log; `X-Marqius-Kern-Note` says what Marqius Kern did that you may want to know.

    ## Gotenberg 8 and 9

    Each request is answered in one of the two APIs. A `/forms/pdf/` route, or a field only Gotenberg 9 reads (`stages`, `paperSize`, the `native...` names), makes it 9.x's; otherwise it is 8.x's, as Gotenberg 8.40.0 answers it. A server started with `--kern-api=8` or `--kern-api=9` answers one alone, and its document describes that one.

    ## Reading this document

    Each operation and field says whose API it is (`x-kern-api`: `gotenberg-8.40.0`, `gotenberg-9.10.3`, or `kern` for Marqius Kern's own, which change nothing unless a request uses them), and each field what Marqius Kern does with it (`x-kern-effect`: `honoured`; `checked` for a field Marqius Kern reads and checks, a wrong value refused in Gotenberg's words, but which changes nothing in its answer, as it tunes only Chromium or LibreOffice or the route does not use it; `noted` for one that does nothing on that route, which Marqius Kern says in its X-Marqius-Kern-Note header). The samples are each operation's `x-codeSamples`. The version is the API's, as `GET /version` answers it.
  contact:
    name: marqius
    url: https://marqius.com
    email: hello@marqius.com
  license:
    name: "Proprietary: the Marqius Kern licence"
    identifier: LicenseRef-marqius-kern
servers:
  - url: "{scheme}://{host}:{port}"
    description: Your Marqius Kern server
    variables:
      scheme:
        enum:
          - http
          - https
        default: http
        description: https where a proxy in front serves it
      host:
        default: localhost
        description: Where the server runs
      port:
        default: "3000"
        description: "--api-port: Gotenberg's port unless set"
security:
  - {}
  - basicAuth: []
tags:
  - name: Chromium
    description: HTML, web pages and Markdown to PDF or to pictures, laid out as Chromium prints them.
  - name: LibreOffice
    description: Office documents (Word, Excel, PowerPoint, OpenDocument, RTF, CSV, text) to PDF, laid out as LibreOffice prints them.
  - name: PDF engines
    description: "Gotenberg 8's PDF tools: merge, split, rotate, protect, stamp, PDF/A, Factur-X, metadata and bookmarks."
  - name: PDF (Gotenberg 9)
    description: "Gotenberg 9's PDF routes: one operation each, or several in order with pipe."
  - name: Marqius Kern
    description: "Marqius Kern's own routes: emails to PDF, scans made searchable, any document as Markdown, and this document."
  - name: System
    description: "The server's own: whether it is up, its version, its metrics."
paths:
  /:
    get:
      operationId: root
      summary: Root
      description: Gotenberg's root sentence, word for word.
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: HTML.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            text/html:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Status401"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: curl http://localhost:3000/
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            r = requests.get("http://localhost:3000/")
            r.raise_for_status()
            print(r.text)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            {
              const res = await fetch("http://localhost:3000/");
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              console.log(await res.text());
            }
    head:
      operationId: rootHead
      summary: Root
      description: Gotenberg's root sentence, word for word.
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: HTML.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            text/html:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Status401"
  /health:
    get:
      operationId: health
      summary: Health
      description: "Whether the server is up: {\"status\":\"up\",\"details\":{...}}. Never behind authentication."
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Health"
              example:
                details:
                  chromium:
                    status: up
                    timestamp: "2026-11-30T16:49:15.315Z"
                  libreoffice:
                    status: up
                    timestamp: "2026-11-30T16:49:15.315Z"
                status: up
      x-codeSamples:
        - lang: Shell
          label: curl
          source: curl http://localhost:3000/health
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            r = requests.get("http://localhost:3000/health")
            r.raise_for_status()
            print(r.text)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            {
              const res = await fetch("http://localhost:3000/health");
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              console.log(await res.text());
            }
    head:
      operationId: healthHead
      summary: Health
      description: "Whether the server is up: {\"status\":\"up\",\"details\":{...}}. Never behind authentication."
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Health"
              example:
                details:
                  chromium:
                    status: up
                    timestamp: "2026-11-30T16:49:15.315Z"
                  libreoffice:
                    status: up
                    timestamp: "2026-11-30T16:49:15.315Z"
                status: up
  /version:
    get:
      operationId: version
      summary: Version
      description: "The version of Gotenberg's API answered: 8.40.0 (the Gotenberg-Version header says the same, X-Marqius-Kern names Marqius Kern's own)."
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: Plain text.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            text/plain:
              schema:
                type: string
              example: "\"8.40.0\""
        "401":
          $ref: "#/components/responses/Status401"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: curl http://localhost:3000/version
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            r = requests.get("http://localhost:3000/version")
            r.raise_for_status()
            print(r.text)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            {
              const res = await fetch("http://localhost:3000/version");
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              console.log(await res.text());
            }
    head:
      operationId: versionHead
      summary: Version
      description: "The version of Gotenberg's API answered: 8.40.0 (the Gotenberg-Version header says the same, X-Marqius-Kern names Marqius Kern's own)."
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: Plain text.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            text/plain:
              schema:
                type: string
              example: "\"8.40.0\""
        "401":
          $ref: "#/components/responses/Status401"
  /prometheus/metrics:
    get:
      operationId: metrics
      summary: Metrics
      description: "The server's metrics in Prometheus's text format, named under --prometheus-namespace (gotenberg): the queues, and the conversions and their times. --prometheus-metrics-path moves the route. Off with `--prometheus-disable-collect`."
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: Plain text.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Status401"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--prometheus-disable-collect"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: curl http://localhost:3000/prometheus/metrics
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            r = requests.get("http://localhost:3000/prometheus/metrics")
            r.raise_for_status()
            print(r.text)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            {
              const res = await fetch("http://localhost:3000/prometheus/metrics");
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              console.log(await res.text());
            }
    head:
      operationId: metricsHead
      summary: Metrics
      description: "The server's metrics in Prometheus's text format, named under --prometheus-namespace (gotenberg): the queues, and the conversions and their times. --prometheus-metrics-path moves the route. Off with `--prometheus-disable-collect`."
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: Plain text.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            text/plain:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Status401"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--prometheus-disable-collect"
  /debug:
    get:
      operationId: debug
      summary: Debug
      description: The server's version, settings and modules as JSON, as Gotenberg's debug route gives them. Answered only with --api-enable-debug-route.
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                type: object
        "401":
          $ref: "#/components/responses/Status401"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            # (a server started with --api-enable-debug-route)
            curl http://localhost:3000/debug
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            # (a server started with --api-enable-debug-route)

            r = requests.get("http://localhost:3000/debug")
            r.raise_for_status()
            print(r.text)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            // (a server started with --api-enable-debug-route)

            {
              const res = await fetch("http://localhost:3000/debug");
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              console.log(await res.text());
            }
    head:
      operationId: debugHead
      summary: Debug
      description: The server's version, settings and modules as JSON, as Gotenberg's debug route gives them. Answered only with --api-enable-debug-route.
      tags:
        - System
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                type: object
        "401":
          $ref: "#/components/responses/Status401"
  /forms/chromium/convert/html:
    post:
      operationId: chromiumConvertHtml
      summary: Convert HTML to PDF
      description: Prints index.html, with the files it names, to PDF, laid out as Chromium prints it. Off with `--chromium-disable-routes`.
      tags:
        - Chromium
      x-kern-api:
        - gotenberg-8.40.0
        - gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "index.html and the files it names (stylesheets, pictures, fonts, scripts), each by its name alone. header.html and footer.html are printed in the top and bottom margins of every page (classes date, title, url, pageNumber and totalPages take those values); Marqius Kern's own header-first.html and footer-first.html stand in for them on the first page (an empty one: none there)."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                skipNetworkIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                skipNetworkAlmostIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go almost idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                failOnHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: |-
                    Answers 409 when the page itself answers one of these statuses: 499 stands for 400 to 499, 599 for 500 to 599.

                    Default: `[499,599]`.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: Answers 409 when a file the page loads (a picture, a stylesheet, a script) answers one of these statuses; ranges as for failOnHttpStatusCodes.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ignoreResourceHttpStatusDomains:
                  type: string
                  contentMediaType: application/json
                  description: "Domains, their subdomains included, that failOnResourceHttpStatusCodes leaves out: [\"sentry-cdn.com\"]."
                  examples:
                    - "[\"example.com\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceLoadingFailed:
                  type: boolean
                  description: |-
                    Answers 409 when a file the page loads cannot be fetched at all.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleExceptions:
                  type: boolean
                  description: |-
                    Answers 409 when the page's script throws an exception.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleMessageTypes:
                  type: string
                  contentMediaType: application/json
                  description: "Answers 409 when the page writes one of these console types: log, debug, info, warning, error or assert."
                  examples:
                    - "[\"error\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitDelay:
                  type: string
                  description: "Waits this long once the page has loaded, before printing: 500ms, 2s."
                  pattern: ^([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+$
                  examples:
                    - "1ms"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForExpression:
                  type: string
                  description: Waits until this JavaScript expression is true, such as `window.ready === true`.
                  examples:
                    - "true"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForSelector:
                  type: string
                  description: Waits until an element matching this CSS selector is on the page, such as `#chart.ready`.
                  examples:
                    - body
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                cookies:
                  type: string
                  contentMediaType: application/json
                  description: "Cookies to set before the page loads: objects with a `name`, a `value` and a `domain`, and optionally a `path`, `secure`, `httpOnly` and `sameSite` (Strict, Lax or None)."
                  examples:
                    - "[{\"name\":\"a\",\"value\":\"b\",\"domain\":\"example.com\"}]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userAgent:
                  type: string
                  description: The User-Agent header the page's requests send.
                  examples:
                    - kern-tests
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                extraHttpHeaders:
                  type: string
                  contentMediaType: application/json
                  description: "Headers the page's requests send: {\"X-Token\": \"abc\"}. A value ending in `;scope=<regex>` is sent only to the addresses the regex matches."
                  examples:
                    - "{\"X-Test\":\"1\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaType:
                  type: string
                  enum:
                    - print
                    - screen
                  description: |-
                    The CSS media type the page is laid out for.

                    Default: `print`.
                  default: print
                  examples:
                    - print
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaFeatures:
                  type: string
                  contentMediaType: application/json
                  description: "CSS media features the page sees: {\"prefers-color-scheme\": \"dark\"}."
                  examples:
                    - "{\"prefers-color-scheme\":\"light\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                omitBackground:
                  type: boolean
                  description: |-
                    Leaves out the white background, for a transparent page or picture; a PDF needs printBackground too.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                landscape:
                  type: boolean
                  description: |-
                    Prints the page on its side.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                printBackground:
                  type: boolean
                  description: |-
                    Prints the page's backgrounds; without it only what the page marks `print-color-adjust: exact` keeps them, as in Chromium.

                    Default: `false`.
                  default: false
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                scale:
                  type: number
                  description: |-
                    Draws the content this many times as big, from 0.1 to 2.

                    Default: `1.0`.
                  minimum: 0.1
                  maximum: 2.0
                  examples:
                    - "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                singlePage:
                  type: boolean
                  description: |-
                    Prints the whole content on one page, as tall as the content.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                paperWidth:
                  type: string
                  description: |-
                    The paper's width: inches, or a number with a unit (210mm, 21cm, 595pt, 794px).

                    Default: `8.5`.
                  default: "8.5"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "8.5"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                paperHeight:
                  type: string
                  description: |-
                    The paper's height.

                    Default: `11`.
                  default: "11"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "11"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginTop:
                  type: string
                  description: |-
                    The top margin; header.html prints in it.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginBottom:
                  type: string
                  description: |-
                    The bottom margin; footer.html prints in it.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginLeft:
                  type: string
                  description: |-
                    The left margin.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginRight:
                  type: string
                  description: |-
                    The right margin.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                preferCssPageSize:
                  type: boolean
                  description: |-
                    Gives the page's own CSS @page size priority over paperWidth and paperHeight. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                generateDocumentOutline:
                  type: boolean
                  description: |-
                    Makes bookmarks from the page's headings.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                generateTaggedPdf:
                  type: boolean
                  description: |-
                    Makes a tagged PDF, whose structure screen readers follow.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativePageRanges:
                  type: string
                  description: "The pages to print, in Chromium's syntax: 1-5, 8, 11-13."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitMode:
                  type: string
                  enum:
                    - intervals
                    - pages
                  description: "Splits the PDF: `intervals` into parts of splitSpan pages, `pages` into the pages splitSpan names. Several parts are answered as a ZIP."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitSpan:
                  type: string
                  description: "The pages of each part: a number of pages for intervals, page ranges (1-3, 5) for pages."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitUnify:
                  type: boolean
                  description: |-
                    With splitMode pages: the pages chosen in one PDF instead of one PDF each.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                metadata:
                  type: string
                  contentMediaType: application/json
                  description: "The PDF's metadata to write: {\"Author\": \"…\", \"Title\": \"…\", \"Keywords\": [\"…\"]}."
                  examples:
                    - "{\"Title\":\"Marqius Kern\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                flatten:
                  type: boolean
                  description: |-
                    Turns form fields and annotations into the page's own drawing.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts the PDF's restrictions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowPrinting:
                  type: boolean
                  description: |-
                    With a password: printing allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowModifying:
                  type: boolean
                  description: |-
                    With a password: changes allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowCopying:
                  type: boolean
                  description: |-
                    With a password: copying text and pictures allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAnnotating:
                  type: boolean
                  description: |-
                    With a password: comments allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowFillingForms:
                  type: boolean
                  description: |-
                    With a password: filling in forms allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAssembling:
                  type: boolean
                  description: |-
                    With a password: inserting, rotating and deleting pages allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stamp:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn over the pages (stampSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the stamp is: text (stampExpression), or the picture or PDF sent as `stamp`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampExpression:
                  type: string
                  description: The stamp's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampPages:
                  type: string
                  description: "The pages stamped: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampOptions:
                  type: string
                  contentMediaType: application/json
                  description: "How the stamp is drawn: {\"font\": \"Helvetica\", \"fontSize\": 24, \"color\": \"#ff0000\", \"opacity\": 0.5, \"rotation\": 45, \"position\": \"center\"}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermark:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn under the pages' content (watermarkSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the watermark is: text (watermarkExpression), or the picture or PDF sent as `watermark`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkExpression:
                  type: string
                  description: The watermark's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkPages:
                  type: string
                  description: "The pages watermarked: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkOptions:
                  type: string
                  contentMediaType: application/json
                  description: How the watermark is drawn, as for stampOptions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotateAngle:
                  type: string
                  enum:
                    - "90"
                    - "180"
                    - "270"
                  description: Turns the pages by this angle, clockwise.
                  examples:
                    - "90"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotatePages:
                  type: string
                  description: "With rotateAngle: the pages turned: 1-3, 5; all when not given."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeImages:
                  type: boolean
                  description: |-
                    Packs the pictures again as JPEG, for a smaller file.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                imageQuality:
                  type: integer
                  description: "With optimizeImages: the JPEG quality, from 1 to 100."
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernOcr:
                  type: string
                  enum:
                    - "true"
                    - "false"
                    - auto
                  description: |-
                    true (or auto): the pages that need it (scans: little text and a large picture) are read and laid over with hidden text, so the PDF can be searched and copied; the pages look as they did. The summary is in the X-Marqius-Kern-Ocr header.

                    Default: `false`.
                  default: "false"
                  examples:
                    - "false"
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrEngine:
                  type: string
                  description: "The engine that reads: Marqius Kern's own (the server's --kern-ocr-engine unless sent: ppocr-v6-tiny; ppocr-v6-small reads more accurately), tesseract, a folder added with `marqius-kern ocr add`, or an OCR server's name (--kern-ocr-server)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrLanguages:
                  type: string
                  description: "The languages or scripts on the pages, comma-separated (ara, heb, hi, korean...): the default engine is swapped for Marqius Kern's engine that reads them."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrPages:
                  type: string
                  description: "The pages to read if they need it: 1-3,5, even, odd, !1; all unless sent."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrOptional:
                  type: boolean
                  description: |-
                    When OCR cannot run (no engine, a model not fetched yet), the file is answered as it is, with a note, instead of an error.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  enum:
                    - PDF/A-1b
                    - PDF/A-2b
                    - PDF/A-3b
                  description: Makes the PDF this PDF/A level, for archiving.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfua:
                  type: boolean
                  description: |-
                    Makes the PDF accessible (PDF/UA).

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embeds:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: Files carried inside the PDF as attachments.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embedsMetadata:
                  type: string
                  contentMediaType: application/json
                  description: "For each file carried inside, by its name: {\"invoice.xml\": {\"mimeType\": \"text/xml\", \"relationship\": \"Data\"}}."
                  examples:
                    - "{\"note.txt\":{\"mimeType\":\"text/plain\"}}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxXml:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "A Factur-X or ZUGFeRD invoice's XML: the PDF is made an e-invoice carrying it (PDF/A-3b)."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxVersion:
                  type: string
                  description: |-
                    The Factur-X version written in the PDF's metadata.

                    Default: `1.0`.
                  default: "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxConformanceLevel:
                  type: string
                  enum:
                    - MINIMUM
                    - BASIC WL
                    - BASIC
                    - EN 16931
                    - EXTENDED
                    - XRECHNUNG
                  description: The invoice XML's profile, when the XML does not say it.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxDocumentType:
                  type: string
                  enum:
                    - INVOICE
                    - ORDER
                    - ORDER_RESPONSE
                    - ORDER_CHANGE
                  description: What the XML is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernBookFeatures:
                  type: boolean
                  description: "Prints what Chromium does not know: running headers (string-set, position: running()), page numbers in contents and cross-references (target-counter), leaders, footnotes (the server's --kern-book-features unless sent)."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFitHeaderFooter:
                  type: boolean
                  description: A header.html or footer.html taller than its margin moves the page's text away rather than covering it (the server's --kern-fit-header-footer unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernContents:
                  type: boolean
                  description: |-
                    A contents page at the front: the headings, each a link, with their page numbers.

                    Default: `false`.
                  default: false
                  examples:
                    - true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernContentsDepth:
                  type: integer
                  description: |-
                    With kernContents: the heading levels listed, 1 to 6.

                    Default: `3`.
                  default: 3
                  minimum: 1
                  maximum: 6
                  examples:
                    - 3
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernContentsTitle:
                  type: string
                  description: |-
                    With kernContents: the contents page's title.

                    Default: `Contents`.
                  default: Contents
                  examples:
                    - Contents
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFirstPageNumber:
                  type: integer
                  description: |-
                    The number the first page is given; the rest count on from it.

                    Default: `1`.
                  default: 1
                  examples:
                    - 1
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFontReport:
                  type: boolean
                  description: Says in the X-Marqius-Kern-Fonts header which fonts each conversion used, their files, and what stood in for what (the server's --kern-font-report unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernRequireFonts:
                  type: string
                  description: "Families this request must have, comma-separated: a conversion that cannot have one is refused (409) instead of printed in another font."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                stages:
                  type: string
                  contentMediaType: application/json
                  description: "Operations run on the PDFs in order, each with its options as /forms/pdf's routes take them: a JSON array such as [{\"op\":\"set-metadata\",\"title\":\"Report\"},{\"op\":\"encrypt\",\"userPassword\":\"open\"}]."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                paperSize:
                  type: string
                  description: A paper by name, such as A4 or Letter, in place of paperWidth and paperHeight.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativePages:
                  type: string
                  description: "The pages to print, in Chromium's syntax (1-5, 8, 11-13): Gotenberg 9's name for nativePageRanges."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeBookmarks:
                  type: boolean
                  description: |-
                    Makes bookmarks from the page's headings: Gotenberg 9's name for generateDocumentOutline.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeTaggedPdf:
                  type: boolean
                  description: |-
                    Makes a tagged PDF: Gotenberg 9's name for generateTaggedPdf.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                waitForWindowStatus:
                  type: string
                  description: Waits until the page sets window.status to this value, before printing.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
              required:
                - files
            encoding:
              stampSource:
                explode: true
              stampExpression:
                explode: true
              stampPages:
                explode: true
              stampOptions:
                explode: true
              watermarkSource:
                explode: true
              watermarkExpression:
                explode: true
              watermarkPages:
                explode: true
              watermarkOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "403":
          $ref: "#/components/responses/Status403"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--chromium-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o hello.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o hello.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("hello.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("hello.pdf", Buffer.from(await res.arrayBuffer()));
            }
        - lang: Shell
          label: curl (Gotenberg 9's fields)
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -F paperSize=A4 -F 'stages=[{"op":"set-metadata","title":"Hello"}]' -o hello-a4.pdf
        - lang: Shell
          label: marqius-kern run (Gotenberg 9's fields), no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -F paperSize=A4 -F 'stages=[{"op":"set-metadata","title":"Hello"}]' -o hello-a4.pdf
        - lang: Python
          label: Python (Gotenberg 9's fields)
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
                ("paperSize", (None, "A4")),
                ("stages", (None, "[{\"op\":\"set-metadata\",\"title\":\"Hello\"}]")),
            ])
            r.raise_for_status()
            with open("hello-a4.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript (Gotenberg 9's fields)
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              form.append("paperSize", "A4");
              form.append("stages", "[{\"op\":\"set-metadata\",\"title\":\"Hello\"}]");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("hello-a4.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/chromium/convert/url:
    post:
      operationId: chromiumConvertUrl
      summary: Convert a web page to PDF
      description: Prints the page at a web address to PDF, laid out as Chromium prints it. Off with `--chromium-disable-routes`.
      tags:
        - Chromium
      x-kern-api:
        - gotenberg-8.40.0
        - gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: "The address of the page to print: http or https."
                  format: uri
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: header.html and footer.html, and the files they name; Marqius Kern's own header-first.html and footer-first.html stand in for them on the first page.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                skipNetworkIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                skipNetworkAlmostIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go almost idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                failOnHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: |-
                    Answers 409 when the page itself answers one of these statuses: 499 stands for 400 to 499, 599 for 500 to 599.

                    Default: `[499,599]`.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: Answers 409 when a file the page loads (a picture, a stylesheet, a script) answers one of these statuses; ranges as for failOnHttpStatusCodes.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ignoreResourceHttpStatusDomains:
                  type: string
                  contentMediaType: application/json
                  description: "Domains, their subdomains included, that failOnResourceHttpStatusCodes leaves out: [\"sentry-cdn.com\"]."
                  examples:
                    - "[\"example.com\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceLoadingFailed:
                  type: boolean
                  description: |-
                    Answers 409 when a file the page loads cannot be fetched at all.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleExceptions:
                  type: boolean
                  description: |-
                    Answers 409 when the page's script throws an exception.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleMessageTypes:
                  type: string
                  contentMediaType: application/json
                  description: "Answers 409 when the page writes one of these console types: log, debug, info, warning, error or assert."
                  examples:
                    - "[\"error\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitDelay:
                  type: string
                  description: "Waits this long once the page has loaded, before printing: 500ms, 2s."
                  pattern: ^([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+$
                  examples:
                    - "1ms"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForExpression:
                  type: string
                  description: Waits until this JavaScript expression is true, such as `window.ready === true`.
                  examples:
                    - "true"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForSelector:
                  type: string
                  description: Waits until an element matching this CSS selector is on the page, such as `#chart.ready`.
                  examples:
                    - body
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                cookies:
                  type: string
                  contentMediaType: application/json
                  description: "Cookies to set before the page loads: objects with a `name`, a `value` and a `domain`, and optionally a `path`, `secure`, `httpOnly` and `sameSite` (Strict, Lax or None)."
                  examples:
                    - "[{\"name\":\"a\",\"value\":\"b\",\"domain\":\"example.com\"}]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userAgent:
                  type: string
                  description: The User-Agent header the page's requests send.
                  examples:
                    - kern-tests
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                extraHttpHeaders:
                  type: string
                  contentMediaType: application/json
                  description: "Headers the page's requests send: {\"X-Token\": \"abc\"}. A value ending in `;scope=<regex>` is sent only to the addresses the regex matches."
                  examples:
                    - "{\"X-Test\":\"1\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaType:
                  type: string
                  enum:
                    - print
                    - screen
                  description: |-
                    The CSS media type the page is laid out for.

                    Default: `print`.
                  default: print
                  examples:
                    - print
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaFeatures:
                  type: string
                  contentMediaType: application/json
                  description: "CSS media features the page sees: {\"prefers-color-scheme\": \"dark\"}."
                  examples:
                    - "{\"prefers-color-scheme\":\"light\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                omitBackground:
                  type: boolean
                  description: |-
                    Leaves out the white background, for a transparent page or picture; a PDF needs printBackground too.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                landscape:
                  type: boolean
                  description: |-
                    Prints the page on its side.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                printBackground:
                  type: boolean
                  description: |-
                    Prints the page's backgrounds; without it only what the page marks `print-color-adjust: exact` keeps them, as in Chromium.

                    Default: `false`.
                  default: false
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                scale:
                  type: number
                  description: |-
                    Draws the content this many times as big, from 0.1 to 2.

                    Default: `1.0`.
                  minimum: 0.1
                  maximum: 2.0
                  examples:
                    - "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                singlePage:
                  type: boolean
                  description: |-
                    Prints the whole content on one page, as tall as the content.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                paperWidth:
                  type: string
                  description: |-
                    The paper's width: inches, or a number with a unit (210mm, 21cm, 595pt, 794px).

                    Default: `8.5`.
                  default: "8.5"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "8.5"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                paperHeight:
                  type: string
                  description: |-
                    The paper's height.

                    Default: `11`.
                  default: "11"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "11"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginTop:
                  type: string
                  description: |-
                    The top margin; header.html prints in it.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginBottom:
                  type: string
                  description: |-
                    The bottom margin; footer.html prints in it.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginLeft:
                  type: string
                  description: |-
                    The left margin.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginRight:
                  type: string
                  description: |-
                    The right margin.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                preferCssPageSize:
                  type: boolean
                  description: |-
                    Gives the page's own CSS @page size priority over paperWidth and paperHeight. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                generateDocumentOutline:
                  type: boolean
                  description: |-
                    Makes bookmarks from the page's headings.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                generateTaggedPdf:
                  type: boolean
                  description: |-
                    Makes a tagged PDF, whose structure screen readers follow.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativePageRanges:
                  type: string
                  description: "The pages to print, in Chromium's syntax: 1-5, 8, 11-13."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitMode:
                  type: string
                  enum:
                    - intervals
                    - pages
                  description: "Splits the PDF: `intervals` into parts of splitSpan pages, `pages` into the pages splitSpan names. Several parts are answered as a ZIP."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitSpan:
                  type: string
                  description: "The pages of each part: a number of pages for intervals, page ranges (1-3, 5) for pages."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitUnify:
                  type: boolean
                  description: |-
                    With splitMode pages: the pages chosen in one PDF instead of one PDF each.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                metadata:
                  type: string
                  contentMediaType: application/json
                  description: "The PDF's metadata to write: {\"Author\": \"…\", \"Title\": \"…\", \"Keywords\": [\"…\"]}."
                  examples:
                    - "{\"Title\":\"Marqius Kern\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                flatten:
                  type: boolean
                  description: |-
                    Turns form fields and annotations into the page's own drawing.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts the PDF's restrictions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowPrinting:
                  type: boolean
                  description: |-
                    With a password: printing allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowModifying:
                  type: boolean
                  description: |-
                    With a password: changes allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowCopying:
                  type: boolean
                  description: |-
                    With a password: copying text and pictures allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAnnotating:
                  type: boolean
                  description: |-
                    With a password: comments allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowFillingForms:
                  type: boolean
                  description: |-
                    With a password: filling in forms allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAssembling:
                  type: boolean
                  description: |-
                    With a password: inserting, rotating and deleting pages allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stamp:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn over the pages (stampSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the stamp is: text (stampExpression), or the picture or PDF sent as `stamp`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampExpression:
                  type: string
                  description: The stamp's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampPages:
                  type: string
                  description: "The pages stamped: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampOptions:
                  type: string
                  contentMediaType: application/json
                  description: "How the stamp is drawn: {\"font\": \"Helvetica\", \"fontSize\": 24, \"color\": \"#ff0000\", \"opacity\": 0.5, \"rotation\": 45, \"position\": \"center\"}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermark:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn under the pages' content (watermarkSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the watermark is: text (watermarkExpression), or the picture or PDF sent as `watermark`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkExpression:
                  type: string
                  description: The watermark's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkPages:
                  type: string
                  description: "The pages watermarked: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkOptions:
                  type: string
                  contentMediaType: application/json
                  description: How the watermark is drawn, as for stampOptions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotateAngle:
                  type: string
                  enum:
                    - "90"
                    - "180"
                    - "270"
                  description: Turns the pages by this angle, clockwise.
                  examples:
                    - "90"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotatePages:
                  type: string
                  description: "With rotateAngle: the pages turned: 1-3, 5; all when not given."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeImages:
                  type: boolean
                  description: |-
                    Packs the pictures again as JPEG, for a smaller file.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                imageQuality:
                  type: integer
                  description: "With optimizeImages: the JPEG quality, from 1 to 100."
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernOcr:
                  type: string
                  enum:
                    - "true"
                    - "false"
                    - auto
                  description: |-
                    true (or auto): the pages that need it (scans: little text and a large picture) are read and laid over with hidden text, so the PDF can be searched and copied; the pages look as they did. The summary is in the X-Marqius-Kern-Ocr header.

                    Default: `false`.
                  default: "false"
                  examples:
                    - "false"
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrEngine:
                  type: string
                  description: "The engine that reads: Marqius Kern's own (the server's --kern-ocr-engine unless sent: ppocr-v6-tiny; ppocr-v6-small reads more accurately), tesseract, a folder added with `marqius-kern ocr add`, or an OCR server's name (--kern-ocr-server)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrLanguages:
                  type: string
                  description: "The languages or scripts on the pages, comma-separated (ara, heb, hi, korean...): the default engine is swapped for Marqius Kern's engine that reads them."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrPages:
                  type: string
                  description: "The pages to read if they need it: 1-3,5, even, odd, !1; all unless sent."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrOptional:
                  type: boolean
                  description: |-
                    When OCR cannot run (no engine, a model not fetched yet), the file is answered as it is, with a note, instead of an error.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  enum:
                    - PDF/A-1b
                    - PDF/A-2b
                    - PDF/A-3b
                  description: Makes the PDF this PDF/A level, for archiving.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfua:
                  type: boolean
                  description: |-
                    Makes the PDF accessible (PDF/UA).

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embeds:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: Files carried inside the PDF as attachments.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embedsMetadata:
                  type: string
                  contentMediaType: application/json
                  description: "For each file carried inside, by its name: {\"invoice.xml\": {\"mimeType\": \"text/xml\", \"relationship\": \"Data\"}}."
                  examples:
                    - "{\"note.txt\":{\"mimeType\":\"text/plain\"}}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxXml:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "A Factur-X or ZUGFeRD invoice's XML: the PDF is made an e-invoice carrying it (PDF/A-3b)."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxVersion:
                  type: string
                  description: |-
                    The Factur-X version written in the PDF's metadata.

                    Default: `1.0`.
                  default: "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxConformanceLevel:
                  type: string
                  enum:
                    - MINIMUM
                    - BASIC WL
                    - BASIC
                    - EN 16931
                    - EXTENDED
                    - XRECHNUNG
                  description: The invoice XML's profile, when the XML does not say it.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxDocumentType:
                  type: string
                  enum:
                    - INVOICE
                    - ORDER
                    - ORDER_RESPONSE
                    - ORDER_CHANGE
                  description: What the XML is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernBookFeatures:
                  type: boolean
                  description: "Prints what Chromium does not know: running headers (string-set, position: running()), page numbers in contents and cross-references (target-counter), leaders, footnotes (the server's --kern-book-features unless sent)."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFitHeaderFooter:
                  type: boolean
                  description: A header.html or footer.html taller than its margin moves the page's text away rather than covering it (the server's --kern-fit-header-footer unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernContents:
                  type: boolean
                  description: |-
                    A contents page at the front: the headings, each a link, with their page numbers.

                    Default: `false`.
                  default: false
                  examples:
                    - true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernContentsDepth:
                  type: integer
                  description: |-
                    With kernContents: the heading levels listed, 1 to 6.

                    Default: `3`.
                  default: 3
                  minimum: 1
                  maximum: 6
                  examples:
                    - 3
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernContentsTitle:
                  type: string
                  description: |-
                    With kernContents: the contents page's title.

                    Default: `Contents`.
                  default: Contents
                  examples:
                    - Contents
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFirstPageNumber:
                  type: integer
                  description: |-
                    The number the first page is given; the rest count on from it.

                    Default: `1`.
                  default: 1
                  examples:
                    - 1
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFontReport:
                  type: boolean
                  description: Says in the X-Marqius-Kern-Fonts header which fonts each conversion used, their files, and what stood in for what (the server's --kern-font-report unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernRequireFonts:
                  type: string
                  description: "Families this request must have, comma-separated: a conversion that cannot have one is refused (409) instead of printed in another font."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                stages:
                  type: string
                  contentMediaType: application/json
                  description: "Operations run on the PDFs in order, each with its options as /forms/pdf's routes take them: a JSON array such as [{\"op\":\"set-metadata\",\"title\":\"Report\"},{\"op\":\"encrypt\",\"userPassword\":\"open\"}]."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                paperSize:
                  type: string
                  description: A paper by name, such as A4 or Letter, in place of paperWidth and paperHeight.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativePages:
                  type: string
                  description: "The pages to print, in Chromium's syntax (1-5, 8, 11-13): Gotenberg 9's name for nativePageRanges."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeBookmarks:
                  type: boolean
                  description: |-
                    Makes bookmarks from the page's headings: Gotenberg 9's name for generateDocumentOutline.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeTaggedPdf:
                  type: boolean
                  description: |-
                    Makes a tagged PDF: Gotenberg 9's name for generateTaggedPdf.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                waitForWindowStatus:
                  type: string
                  description: Waits until the page sets window.status to this value, before printing.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
              required:
                - url
            encoding:
              stampSource:
                explode: true
              stampExpression:
                explode: true
              stampPages:
                explode: true
              stampOptions:
                explode: true
              watermarkSource:
                explode: true
              watermarkExpression:
                explode: true
              watermarkPages:
                explode: true
              watermarkOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "403":
          $ref: "#/components/responses/Status403"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--chromium-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: curl http://localhost:3000/forms/chromium/convert/url -F url=https://example.com -o example.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: marqius-kern run /forms/chromium/convert/url -F url=https://example.com -o example.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            r = requests.post("http://localhost:3000/forms/chromium/convert/url", files=[
                ("url", (None, "https://example.com")),
            ])
            r.raise_for_status()
            with open("example.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            {
              const form = new FormData();
              form.append("url", "https://example.com");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/url", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("example.pdf", Buffer.from(await res.arrayBuffer()));
            }
        - lang: Shell
          label: curl (Gotenberg 9's fields)
          source: curl http://localhost:3000/forms/chromium/convert/url -F url=https://example.com -F paperSize=A4 -o example-a4.pdf
        - lang: Shell
          label: marqius-kern run (Gotenberg 9's fields), no server
          source: marqius-kern run /forms/chromium/convert/url -F url=https://example.com -F paperSize=A4 -o example-a4.pdf
        - lang: Python
          label: Python (Gotenberg 9's fields)
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            r = requests.post("http://localhost:3000/forms/chromium/convert/url", files=[
                ("url", (None, "https://example.com")),
                ("paperSize", (None, "A4")),
            ])
            r.raise_for_status()
            with open("example-a4.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript (Gotenberg 9's fields)
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            {
              const form = new FormData();
              form.append("url", "https://example.com");
              form.append("paperSize", "A4");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/url", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("example-a4.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/chromium/convert/markdown:
    post:
      operationId: chromiumConvertMarkdown
      summary: Convert Markdown to PDF
      description: Prints Markdown files, placed in index.html, to PDF. Off with `--chromium-disable-routes`.
      tags:
        - Chromium
      x-kern-api:
        - gotenberg-8.40.0
        - gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: index.html, which places each Markdown file with {{ toHTML "file.md" }}, the .md files, and the files the page names; header.html and footer.html as on the HTML route.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                skipNetworkIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                skipNetworkAlmostIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go almost idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                failOnHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: |-
                    Answers 409 when the page itself answers one of these statuses: 499 stands for 400 to 499, 599 for 500 to 599.

                    Default: `[499,599]`.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: Answers 409 when a file the page loads (a picture, a stylesheet, a script) answers one of these statuses; ranges as for failOnHttpStatusCodes.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ignoreResourceHttpStatusDomains:
                  type: string
                  contentMediaType: application/json
                  description: "Domains, their subdomains included, that failOnResourceHttpStatusCodes leaves out: [\"sentry-cdn.com\"]."
                  examples:
                    - "[\"example.com\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceLoadingFailed:
                  type: boolean
                  description: |-
                    Answers 409 when a file the page loads cannot be fetched at all.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleExceptions:
                  type: boolean
                  description: |-
                    Answers 409 when the page's script throws an exception.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleMessageTypes:
                  type: string
                  contentMediaType: application/json
                  description: "Answers 409 when the page writes one of these console types: log, debug, info, warning, error or assert."
                  examples:
                    - "[\"error\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitDelay:
                  type: string
                  description: "Waits this long once the page has loaded, before printing: 500ms, 2s."
                  pattern: ^([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+$
                  examples:
                    - "1ms"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForExpression:
                  type: string
                  description: Waits until this JavaScript expression is true, such as `window.ready === true`.
                  examples:
                    - "true"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForSelector:
                  type: string
                  description: Waits until an element matching this CSS selector is on the page, such as `#chart.ready`.
                  examples:
                    - body
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                cookies:
                  type: string
                  contentMediaType: application/json
                  description: "Cookies to set before the page loads: objects with a `name`, a `value` and a `domain`, and optionally a `path`, `secure`, `httpOnly` and `sameSite` (Strict, Lax or None)."
                  examples:
                    - "[{\"name\":\"a\",\"value\":\"b\",\"domain\":\"example.com\"}]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userAgent:
                  type: string
                  description: The User-Agent header the page's requests send.
                  examples:
                    - kern-tests
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                extraHttpHeaders:
                  type: string
                  contentMediaType: application/json
                  description: "Headers the page's requests send: {\"X-Token\": \"abc\"}. A value ending in `;scope=<regex>` is sent only to the addresses the regex matches."
                  examples:
                    - "{\"X-Test\":\"1\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaType:
                  type: string
                  enum:
                    - print
                    - screen
                  description: |-
                    The CSS media type the page is laid out for.

                    Default: `print`.
                  default: print
                  examples:
                    - print
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaFeatures:
                  type: string
                  contentMediaType: application/json
                  description: "CSS media features the page sees: {\"prefers-color-scheme\": \"dark\"}."
                  examples:
                    - "{\"prefers-color-scheme\":\"light\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                omitBackground:
                  type: boolean
                  description: |-
                    Leaves out the white background, for a transparent page or picture; a PDF needs printBackground too.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                landscape:
                  type: boolean
                  description: |-
                    Prints the page on its side.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                printBackground:
                  type: boolean
                  description: |-
                    Prints the page's backgrounds; without it only what the page marks `print-color-adjust: exact` keeps them, as in Chromium.

                    Default: `false`.
                  default: false
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                scale:
                  type: number
                  description: |-
                    Draws the content this many times as big, from 0.1 to 2.

                    Default: `1.0`.
                  minimum: 0.1
                  maximum: 2.0
                  examples:
                    - "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                singlePage:
                  type: boolean
                  description: |-
                    Prints the whole content on one page, as tall as the content.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                paperWidth:
                  type: string
                  description: |-
                    The paper's width: inches, or a number with a unit (210mm, 21cm, 595pt, 794px).

                    Default: `8.5`.
                  default: "8.5"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "8.5"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                paperHeight:
                  type: string
                  description: |-
                    The paper's height.

                    Default: `11`.
                  default: "11"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "11"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginTop:
                  type: string
                  description: |-
                    The top margin; header.html prints in it.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginBottom:
                  type: string
                  description: |-
                    The bottom margin; footer.html prints in it.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginLeft:
                  type: string
                  description: |-
                    The left margin.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                marginRight:
                  type: string
                  description: |-
                    The right margin.

                    Default: `0.39`.
                  default: "0.39"
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  examples:
                    - "0.39"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                preferCssPageSize:
                  type: boolean
                  description: |-
                    Gives the page's own CSS @page size priority over paperWidth and paperHeight. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                generateDocumentOutline:
                  type: boolean
                  description: |-
                    Makes bookmarks from the page's headings.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                generateTaggedPdf:
                  type: boolean
                  description: |-
                    Makes a tagged PDF, whose structure screen readers follow.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativePageRanges:
                  type: string
                  description: "The pages to print, in Chromium's syntax: 1-5, 8, 11-13."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitMode:
                  type: string
                  enum:
                    - intervals
                    - pages
                  description: "Splits the PDF: `intervals` into parts of splitSpan pages, `pages` into the pages splitSpan names. Several parts are answered as a ZIP."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitSpan:
                  type: string
                  description: "The pages of each part: a number of pages for intervals, page ranges (1-3, 5) for pages."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitUnify:
                  type: boolean
                  description: |-
                    With splitMode pages: the pages chosen in one PDF instead of one PDF each.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                metadata:
                  type: string
                  contentMediaType: application/json
                  description: "The PDF's metadata to write: {\"Author\": \"…\", \"Title\": \"…\", \"Keywords\": [\"…\"]}."
                  examples:
                    - "{\"Title\":\"Marqius Kern\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                flatten:
                  type: boolean
                  description: |-
                    Turns form fields and annotations into the page's own drawing.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts the PDF's restrictions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowPrinting:
                  type: boolean
                  description: |-
                    With a password: printing allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowModifying:
                  type: boolean
                  description: |-
                    With a password: changes allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowCopying:
                  type: boolean
                  description: |-
                    With a password: copying text and pictures allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAnnotating:
                  type: boolean
                  description: |-
                    With a password: comments allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowFillingForms:
                  type: boolean
                  description: |-
                    With a password: filling in forms allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAssembling:
                  type: boolean
                  description: |-
                    With a password: inserting, rotating and deleting pages allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stamp:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn over the pages (stampSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the stamp is: text (stampExpression), or the picture or PDF sent as `stamp`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampExpression:
                  type: string
                  description: The stamp's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampPages:
                  type: string
                  description: "The pages stamped: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampOptions:
                  type: string
                  contentMediaType: application/json
                  description: "How the stamp is drawn: {\"font\": \"Helvetica\", \"fontSize\": 24, \"color\": \"#ff0000\", \"opacity\": 0.5, \"rotation\": 45, \"position\": \"center\"}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermark:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn under the pages' content (watermarkSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the watermark is: text (watermarkExpression), or the picture or PDF sent as `watermark`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkExpression:
                  type: string
                  description: The watermark's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkPages:
                  type: string
                  description: "The pages watermarked: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkOptions:
                  type: string
                  contentMediaType: application/json
                  description: How the watermark is drawn, as for stampOptions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotateAngle:
                  type: string
                  enum:
                    - "90"
                    - "180"
                    - "270"
                  description: Turns the pages by this angle, clockwise.
                  examples:
                    - "90"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotatePages:
                  type: string
                  description: "With rotateAngle: the pages turned: 1-3, 5; all when not given."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeImages:
                  type: boolean
                  description: |-
                    Packs the pictures again as JPEG, for a smaller file.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                imageQuality:
                  type: integer
                  description: "With optimizeImages: the JPEG quality, from 1 to 100."
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernOcr:
                  type: string
                  enum:
                    - "true"
                    - "false"
                    - auto
                  description: |-
                    true (or auto): the pages that need it (scans: little text and a large picture) are read and laid over with hidden text, so the PDF can be searched and copied; the pages look as they did. The summary is in the X-Marqius-Kern-Ocr header.

                    Default: `false`.
                  default: "false"
                  examples:
                    - "false"
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrEngine:
                  type: string
                  description: "The engine that reads: Marqius Kern's own (the server's --kern-ocr-engine unless sent: ppocr-v6-tiny; ppocr-v6-small reads more accurately), tesseract, a folder added with `marqius-kern ocr add`, or an OCR server's name (--kern-ocr-server)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrLanguages:
                  type: string
                  description: "The languages or scripts on the pages, comma-separated (ara, heb, hi, korean...): the default engine is swapped for Marqius Kern's engine that reads them."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrPages:
                  type: string
                  description: "The pages to read if they need it: 1-3,5, even, odd, !1; all unless sent."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrOptional:
                  type: boolean
                  description: |-
                    When OCR cannot run (no engine, a model not fetched yet), the file is answered as it is, with a note, instead of an error.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  enum:
                    - PDF/A-1b
                    - PDF/A-2b
                    - PDF/A-3b
                  description: Makes the PDF this PDF/A level, for archiving.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfua:
                  type: boolean
                  description: |-
                    Makes the PDF accessible (PDF/UA).

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embeds:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: Files carried inside the PDF as attachments.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embedsMetadata:
                  type: string
                  contentMediaType: application/json
                  description: "For each file carried inside, by its name: {\"invoice.xml\": {\"mimeType\": \"text/xml\", \"relationship\": \"Data\"}}."
                  examples:
                    - "{\"note.txt\":{\"mimeType\":\"text/plain\"}}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxXml:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "A Factur-X or ZUGFeRD invoice's XML: the PDF is made an e-invoice carrying it (PDF/A-3b)."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxVersion:
                  type: string
                  description: |-
                    The Factur-X version written in the PDF's metadata.

                    Default: `1.0`.
                  default: "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxConformanceLevel:
                  type: string
                  enum:
                    - MINIMUM
                    - BASIC WL
                    - BASIC
                    - EN 16931
                    - EXTENDED
                    - XRECHNUNG
                  description: The invoice XML's profile, when the XML does not say it.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxDocumentType:
                  type: string
                  enum:
                    - INVOICE
                    - ORDER
                    - ORDER_RESPONSE
                    - ORDER_CHANGE
                  description: What the XML is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernBookFeatures:
                  type: boolean
                  description: "Prints what Chromium does not know: running headers (string-set, position: running()), page numbers in contents and cross-references (target-counter), leaders, footnotes (the server's --kern-book-features unless sent)."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFitHeaderFooter:
                  type: boolean
                  description: A header.html or footer.html taller than its margin moves the page's text away rather than covering it (the server's --kern-fit-header-footer unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernContents:
                  type: boolean
                  description: |-
                    A contents page at the front: the headings, each a link, with their page numbers.

                    Default: `false`.
                  default: false
                  examples:
                    - true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernContentsDepth:
                  type: integer
                  description: |-
                    With kernContents: the heading levels listed, 1 to 6.

                    Default: `3`.
                  default: 3
                  minimum: 1
                  maximum: 6
                  examples:
                    - 3
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernContentsTitle:
                  type: string
                  description: |-
                    With kernContents: the contents page's title.

                    Default: `Contents`.
                  default: Contents
                  examples:
                    - Contents
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFirstPageNumber:
                  type: integer
                  description: |-
                    The number the first page is given; the rest count on from it.

                    Default: `1`.
                  default: 1
                  examples:
                    - 1
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFontReport:
                  type: boolean
                  description: Says in the X-Marqius-Kern-Fonts header which fonts each conversion used, their files, and what stood in for what (the server's --kern-font-report unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernRequireFonts:
                  type: string
                  description: "Families this request must have, comma-separated: a conversion that cannot have one is refused (409) instead of printed in another font."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                stages:
                  type: string
                  contentMediaType: application/json
                  description: "Operations run on the PDFs in order, each with its options as /forms/pdf's routes take them: a JSON array such as [{\"op\":\"set-metadata\",\"title\":\"Report\"},{\"op\":\"encrypt\",\"userPassword\":\"open\"}]."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                paperSize:
                  type: string
                  description: A paper by name, such as A4 or Letter, in place of paperWidth and paperHeight.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativePages:
                  type: string
                  description: "The pages to print, in Chromium's syntax (1-5, 8, 11-13): Gotenberg 9's name for nativePageRanges."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeBookmarks:
                  type: boolean
                  description: |-
                    Makes bookmarks from the page's headings: Gotenberg 9's name for generateDocumentOutline.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeTaggedPdf:
                  type: boolean
                  description: |-
                    Makes a tagged PDF: Gotenberg 9's name for generateTaggedPdf.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                waitForWindowStatus:
                  type: string
                  description: Waits until the page sets window.status to this value, before printing.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
              required:
                - files
            encoding:
              stampSource:
                explode: true
              stampExpression:
                explode: true
              stampPages:
                explode: true
              stampOptions:
                explode: true
              watermarkSource:
                explode: true
              watermarkExpression:
                explode: true
              watermarkPages:
                explode: true
              watermarkOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "403":
          $ref: "#/components/responses/Status403"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--chromium-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body>{{ toHTML "notes.md" }}</body></html>' > index.html
            printf '# Notes\n\n- Agreed on Monday\n- Ships on Friday\n' > notes.md
            curl http://localhost:3000/forms/chromium/convert/markdown -F files=@index.html -F files=@notes.md -o notes.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body>{{ toHTML "notes.md" }}</body></html>' > index.html
            printf '# Notes\n\n- Agreed on Monday\n- Ships on Friday\n' > notes.md
            marqius-kern run /forms/chromium/convert/markdown -F files=@index.html -F files=@notes.md -o notes.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body>{{ toHTML \"notes.md\" }}</body></html>")

            with open("notes.md", "w") as f:
                f.write('''# Notes

            - Agreed on Monday
            - Ships on Friday
            ''')

            r = requests.post("http://localhost:3000/forms/chromium/convert/markdown", files=[
                ("files", ("index.html", open("index.html", "rb"))),
                ("files", ("notes.md", open("notes.md", "rb"))),
            ])
            r.raise_for_status()
            with open("notes.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body>{{ toHTML \"notes.md\" }}</body></html>");

            await writeFile("notes.md", `# Notes

            - Agreed on Monday
            - Ships on Friday
            `);

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              form.append("files", new Blob([await readFile("notes.md")]), "notes.md");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/markdown", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("notes.pdf", Buffer.from(await res.arrayBuffer()));
            }
        - lang: Shell
          label: curl (Gotenberg 9's fields)
          source: |-
            printf '<!doctype html><html><body>{{ toHTML "notes.md" }}</body></html>' > index.html
            printf '# Notes\n\n- Agreed on Monday\n- Ships on Friday\n' > notes.md
            curl http://localhost:3000/forms/chromium/convert/markdown -F files=@index.html -F files=@notes.md -F nativeBookmarks=true -F paperSize=A5 -o notes-a5.pdf
        - lang: Shell
          label: marqius-kern run (Gotenberg 9's fields), no server
          source: |-
            printf '<!doctype html><html><body>{{ toHTML "notes.md" }}</body></html>' > index.html
            printf '# Notes\n\n- Agreed on Monday\n- Ships on Friday\n' > notes.md
            marqius-kern run /forms/chromium/convert/markdown -F files=@index.html -F files=@notes.md -F nativeBookmarks=true -F paperSize=A5 -o notes-a5.pdf
        - lang: Python
          label: Python (Gotenberg 9's fields)
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body>{{ toHTML \"notes.md\" }}</body></html>")

            with open("notes.md", "w") as f:
                f.write('''# Notes

            - Agreed on Monday
            - Ships on Friday
            ''')

            r = requests.post("http://localhost:3000/forms/chromium/convert/markdown", files=[
                ("files", ("index.html", open("index.html", "rb"))),
                ("files", ("notes.md", open("notes.md", "rb"))),
                ("nativeBookmarks", (None, "true")),
                ("paperSize", (None, "A5")),
            ])
            r.raise_for_status()
            with open("notes-a5.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript (Gotenberg 9's fields)
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body>{{ toHTML \"notes.md\" }}</body></html>");

            await writeFile("notes.md", `# Notes

            - Agreed on Monday
            - Ships on Friday
            `);

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              form.append("files", new Blob([await readFile("notes.md")]), "notes.md");
              form.append("nativeBookmarks", "true");
              form.append("paperSize", "A5");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/markdown", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("notes-a5.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/chromium/screenshot/html:
    post:
      operationId: chromiumScreenshotHtml
      summary: Take a picture of HTML
      description: A picture of index.html, with the files it names. Off with `--chromium-disable-routes`.
      tags:
        - Chromium
      x-kern-api:
        - gotenberg-8.40.0
        - gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "index.html and the files it names (stylesheets, pictures, fonts, scripts), each by its name alone. header.html and footer.html are printed in the top and bottom margins of every page (classes date, title, url, pageNumber and totalPages take those values); Marqius Kern's own header-first.html and footer-first.html stand in for them on the first page (an empty one: none there)."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                skipNetworkIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                skipNetworkAlmostIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go almost idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                failOnHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: |-
                    Answers 409 when the page itself answers one of these statuses: 499 stands for 400 to 499, 599 for 500 to 599.

                    Default: `[499,599]`.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: Answers 409 when a file the page loads (a picture, a stylesheet, a script) answers one of these statuses; ranges as for failOnHttpStatusCodes.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ignoreResourceHttpStatusDomains:
                  type: string
                  contentMediaType: application/json
                  description: "Domains, their subdomains included, that failOnResourceHttpStatusCodes leaves out: [\"sentry-cdn.com\"]."
                  examples:
                    - "[\"example.com\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceLoadingFailed:
                  type: boolean
                  description: |-
                    Answers 409 when a file the page loads cannot be fetched at all.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleExceptions:
                  type: boolean
                  description: |-
                    Answers 409 when the page's script throws an exception.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleMessageTypes:
                  type: string
                  contentMediaType: application/json
                  description: "Answers 409 when the page writes one of these console types: log, debug, info, warning, error or assert."
                  examples:
                    - "[\"error\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitDelay:
                  type: string
                  description: "Waits this long once the page has loaded, before printing: 500ms, 2s."
                  pattern: ^([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+$
                  examples:
                    - "1ms"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForExpression:
                  type: string
                  description: Waits until this JavaScript expression is true, such as `window.ready === true`.
                  examples:
                    - "true"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForSelector:
                  type: string
                  description: Waits until an element matching this CSS selector is on the page, such as `#chart.ready`.
                  examples:
                    - body
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                cookies:
                  type: string
                  contentMediaType: application/json
                  description: "Cookies to set before the page loads: objects with a `name`, a `value` and a `domain`, and optionally a `path`, `secure`, `httpOnly` and `sameSite` (Strict, Lax or None)."
                  examples:
                    - "[{\"name\":\"a\",\"value\":\"b\",\"domain\":\"example.com\"}]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userAgent:
                  type: string
                  description: The User-Agent header the page's requests send.
                  examples:
                    - kern-tests
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                extraHttpHeaders:
                  type: string
                  contentMediaType: application/json
                  description: "Headers the page's requests send: {\"X-Token\": \"abc\"}. A value ending in `;scope=<regex>` is sent only to the addresses the regex matches."
                  examples:
                    - "{\"X-Test\":\"1\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaType:
                  type: string
                  enum:
                    - print
                    - screen
                  description: |-
                    The CSS media type the page is laid out for.

                    Default: `print`.
                  default: print
                  examples:
                    - print
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaFeatures:
                  type: string
                  contentMediaType: application/json
                  description: "CSS media features the page sees: {\"prefers-color-scheme\": \"dark\"}."
                  examples:
                    - "{\"prefers-color-scheme\":\"light\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                omitBackground:
                  type: boolean
                  description: |-
                    Leaves out the white background, for a transparent page or picture; a PDF needs printBackground too.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                width:
                  type: integer
                  description: |-
                    The window's width in pixels.

                    Default: `800`.
                  default: 800
                  examples:
                    - 800
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                height:
                  type: integer
                  description: |-
                    The window's height in pixels.

                    Default: `600`.
                  default: 600
                  examples:
                    - 600
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                clip:
                  type: boolean
                  description: |-
                    Takes the window alone, not the whole page.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                selector:
                  type: string
                  description: Takes the first element matching this CSS selector alone.
                  examples:
                    - body
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                format:
                  type: string
                  enum:
                    - png
                    - jpeg
                    - webp
                  description: |-
                    The picture's format (Marqius Kern's --kern-screenshot-format sets another default for the server).

                    Default: `png`.
                  default: png
                  examples:
                    - png
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                quality:
                  type: integer
                  description: |-
                    JPEG and WebP quality, from 0 to 100.

                    Default: `100`.
                  default: 100
                  minimum: 0
                  maximum: 100
                  examples:
                    - 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeForSpeed:
                  type: boolean
                  description: |-
                    Lets Chromium compress faster and larger. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                deviceScaleFactor:
                  type: number
                  description: |-
                    Pixels per CSS pixel: 2 takes a picture twice as wide and tall.

                    Default: `1.0`.
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernBookFeatures:
                  type: boolean
                  description: "Prints what Chromium does not know: running headers (string-set, position: running()), page numbers in contents and cross-references (target-counter), leaders, footnotes (the server's --kern-book-features unless sent)."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFontReport:
                  type: boolean
                  description: Says in the X-Marqius-Kern-Fonts header which fonts each conversion used, their files, and what stood in for what (the server's --kern-font-report unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernRequireFonts:
                  type: string
                  description: "Families this request must have, comma-separated: a conversion that cannot have one is refused (409) instead of printed in another font."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: "Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificatePassword:
                  type: string
                  description: "Opens the store or the key; never logged, never echoed. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignReason:
                  type: string
                  description: "The reason the signature gives (the server's --kern-sign-reason unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignLocation:
                  type: string
                  description: "Where the signature says it was made (the server's --kern-sign-location unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignContactInfo:
                  type: string
                  description: "How to reach the signer (the server's --kern-sign-contact-info unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignName:
                  type: string
                  description: "The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignTimestampUrl:
                  type: string
                  description: "An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignField:
                  type: string
                  description: "Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                waitForWindowStatus:
                  type: string
                  description: Waits until the page sets window.status to this value, before the picture is taken.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: "The picture: PNG, JPEG or WebP, as `format` asks; several as a ZIP."
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            image/png:
              schema:
                type: string
                contentMediaType: image/png
            image/jpeg:
              schema:
                type: string
                contentMediaType: image/jpeg
            image/webp:
              schema:
                type: string
                contentMediaType: image/webp
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "403":
          $ref: "#/components/responses/Status403"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--chromium-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  image/png:
                    schema:
                      type: string
                      contentMediaType: image/png
                  image/jpeg:
                    schema:
                      type: string
                      contentMediaType: image/jpeg
                  image/webp:
                    schema:
                      type: string
                      contentMediaType: image/webp
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/screenshot/html -F files=@index.html -o hello.png
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/screenshot/html -F files=@index.html -o hello.png
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/screenshot/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("hello.png", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/screenshot/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("hello.png", Buffer.from(await res.arrayBuffer()));
            }
        - lang: Shell
          label: curl (Gotenberg 9's fields)
          source: |-
            printf '<!doctype html><html><body><h1 id=t>Loading</h1><script>setTimeout(function () { t.textContent = "Ready"; window.status = "ready" }, 200)</script></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/screenshot/html -F files=@index.html -F waitForWindowStatus=ready -o ready.png
        - lang: Shell
          label: marqius-kern run (Gotenberg 9's fields), no server
          source: |-
            printf '<!doctype html><html><body><h1 id=t>Loading</h1><script>setTimeout(function () { t.textContent = "Ready"; window.status = "ready" }, 200)</script></body></html>' > index.html
            marqius-kern run /forms/chromium/screenshot/html -F files=@index.html -F waitForWindowStatus=ready -o ready.png
        - lang: Python
          label: Python (Gotenberg 9's fields)
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1 id=t>Loading</h1><script>setTimeout(function () { t.textContent = \"Ready\"; window.status = \"ready\" }, 200)</script></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/screenshot/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
                ("waitForWindowStatus", (None, "ready")),
            ])
            r.raise_for_status()
            with open("ready.png", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript (Gotenberg 9's fields)
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1 id=t>Loading</h1><script>setTimeout(function () { t.textContent = \"Ready\"; window.status = \"ready\" }, 200)</script></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              form.append("waitForWindowStatus", "ready");
              const res = await fetch("http://localhost:3000/forms/chromium/screenshot/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("ready.png", Buffer.from(await res.arrayBuffer()));
            }
  /forms/chromium/screenshot/url:
    post:
      operationId: chromiumScreenshotUrl
      summary: Take a picture of a web page
      description: A picture of the page at a web address. Off with `--chromium-disable-routes`.
      tags:
        - Chromium
      x-kern-api:
        - gotenberg-8.40.0
        - gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: "The address of the page to print: http or https."
                  format: uri
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: header.html and footer.html, and the files they name; Marqius Kern's own header-first.html and footer-first.html stand in for them on the first page.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                skipNetworkIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                skipNetworkAlmostIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go almost idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                failOnHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: |-
                    Answers 409 when the page itself answers one of these statuses: 499 stands for 400 to 499, 599 for 500 to 599.

                    Default: `[499,599]`.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: Answers 409 when a file the page loads (a picture, a stylesheet, a script) answers one of these statuses; ranges as for failOnHttpStatusCodes.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ignoreResourceHttpStatusDomains:
                  type: string
                  contentMediaType: application/json
                  description: "Domains, their subdomains included, that failOnResourceHttpStatusCodes leaves out: [\"sentry-cdn.com\"]."
                  examples:
                    - "[\"example.com\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceLoadingFailed:
                  type: boolean
                  description: |-
                    Answers 409 when a file the page loads cannot be fetched at all.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleExceptions:
                  type: boolean
                  description: |-
                    Answers 409 when the page's script throws an exception.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleMessageTypes:
                  type: string
                  contentMediaType: application/json
                  description: "Answers 409 when the page writes one of these console types: log, debug, info, warning, error or assert."
                  examples:
                    - "[\"error\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitDelay:
                  type: string
                  description: "Waits this long once the page has loaded, before printing: 500ms, 2s."
                  pattern: ^([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+$
                  examples:
                    - "1ms"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForExpression:
                  type: string
                  description: Waits until this JavaScript expression is true, such as `window.ready === true`.
                  examples:
                    - "true"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForSelector:
                  type: string
                  description: Waits until an element matching this CSS selector is on the page, such as `#chart.ready`.
                  examples:
                    - body
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                cookies:
                  type: string
                  contentMediaType: application/json
                  description: "Cookies to set before the page loads: objects with a `name`, a `value` and a `domain`, and optionally a `path`, `secure`, `httpOnly` and `sameSite` (Strict, Lax or None)."
                  examples:
                    - "[{\"name\":\"a\",\"value\":\"b\",\"domain\":\"example.com\"}]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userAgent:
                  type: string
                  description: The User-Agent header the page's requests send.
                  examples:
                    - kern-tests
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                extraHttpHeaders:
                  type: string
                  contentMediaType: application/json
                  description: "Headers the page's requests send: {\"X-Token\": \"abc\"}. A value ending in `;scope=<regex>` is sent only to the addresses the regex matches."
                  examples:
                    - "{\"X-Test\":\"1\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaType:
                  type: string
                  enum:
                    - print
                    - screen
                  description: |-
                    The CSS media type the page is laid out for.

                    Default: `print`.
                  default: print
                  examples:
                    - print
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaFeatures:
                  type: string
                  contentMediaType: application/json
                  description: "CSS media features the page sees: {\"prefers-color-scheme\": \"dark\"}."
                  examples:
                    - "{\"prefers-color-scheme\":\"light\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                omitBackground:
                  type: boolean
                  description: |-
                    Leaves out the white background, for a transparent page or picture; a PDF needs printBackground too.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                width:
                  type: integer
                  description: |-
                    The window's width in pixels.

                    Default: `800`.
                  default: 800
                  examples:
                    - 800
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                height:
                  type: integer
                  description: |-
                    The window's height in pixels.

                    Default: `600`.
                  default: 600
                  examples:
                    - 600
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                clip:
                  type: boolean
                  description: |-
                    Takes the window alone, not the whole page.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                selector:
                  type: string
                  description: Takes the first element matching this CSS selector alone.
                  examples:
                    - body
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                format:
                  type: string
                  enum:
                    - png
                    - jpeg
                    - webp
                  description: |-
                    The picture's format (Marqius Kern's --kern-screenshot-format sets another default for the server).

                    Default: `png`.
                  default: png
                  examples:
                    - png
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                quality:
                  type: integer
                  description: |-
                    JPEG and WebP quality, from 0 to 100.

                    Default: `100`.
                  default: 100
                  minimum: 0
                  maximum: 100
                  examples:
                    - 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeForSpeed:
                  type: boolean
                  description: |-
                    Lets Chromium compress faster and larger. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                deviceScaleFactor:
                  type: number
                  description: |-
                    Pixels per CSS pixel: 2 takes a picture twice as wide and tall.

                    Default: `1.0`.
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernBookFeatures:
                  type: boolean
                  description: "Prints what Chromium does not know: running headers (string-set, position: running()), page numbers in contents and cross-references (target-counter), leaders, footnotes (the server's --kern-book-features unless sent)."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFontReport:
                  type: boolean
                  description: Says in the X-Marqius-Kern-Fonts header which fonts each conversion used, their files, and what stood in for what (the server's --kern-font-report unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernRequireFonts:
                  type: string
                  description: "Families this request must have, comma-separated: a conversion that cannot have one is refused (409) instead of printed in another font."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: "Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificatePassword:
                  type: string
                  description: "Opens the store or the key; never logged, never echoed. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignReason:
                  type: string
                  description: "The reason the signature gives (the server's --kern-sign-reason unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignLocation:
                  type: string
                  description: "Where the signature says it was made (the server's --kern-sign-location unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignContactInfo:
                  type: string
                  description: "How to reach the signer (the server's --kern-sign-contact-info unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignName:
                  type: string
                  description: "The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignTimestampUrl:
                  type: string
                  description: "An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignField:
                  type: string
                  description: "Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                waitForWindowStatus:
                  type: string
                  description: Waits until the page sets window.status to this value, before the picture is taken.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
              required:
                - url
      responses:
        "200":
          description: "The picture: PNG, JPEG or WebP, as `format` asks; several as a ZIP."
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            image/png:
              schema:
                type: string
                contentMediaType: image/png
            image/jpeg:
              schema:
                type: string
                contentMediaType: image/jpeg
            image/webp:
              schema:
                type: string
                contentMediaType: image/webp
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "403":
          $ref: "#/components/responses/Status403"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--chromium-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  image/png:
                    schema:
                      type: string
                      contentMediaType: image/png
                  image/jpeg:
                    schema:
                      type: string
                      contentMediaType: image/jpeg
                  image/webp:
                    schema:
                      type: string
                      contentMediaType: image/webp
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: curl http://localhost:3000/forms/chromium/screenshot/url -F url=https://example.com -o example.png
        - lang: Shell
          label: marqius-kern run, no server
          source: marqius-kern run /forms/chromium/screenshot/url -F url=https://example.com -o example.png
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            r = requests.post("http://localhost:3000/forms/chromium/screenshot/url", files=[
                ("url", (None, "https://example.com")),
            ])
            r.raise_for_status()
            with open("example.png", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            {
              const form = new FormData();
              form.append("url", "https://example.com");
              const res = await fetch("http://localhost:3000/forms/chromium/screenshot/url", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("example.png", Buffer.from(await res.arrayBuffer()));
            }
  /forms/chromium/screenshot/markdown:
    post:
      operationId: chromiumScreenshotMarkdown
      summary: Take a picture of Markdown
      description: A picture of Markdown files, placed in index.html. Off with `--chromium-disable-routes`.
      tags:
        - Chromium
      x-kern-api:
        - gotenberg-8.40.0
        - gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: index.html, which places each Markdown file with {{ toHTML "file.md" }}, the .md files, and the files the page names; header.html and footer.html as on the HTML route.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                skipNetworkIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                skipNetworkAlmostIdleEvent:
                  type: boolean
                  description: |-
                    Prints without waiting for the network to go almost idle. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                failOnHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: |-
                    Answers 409 when the page itself answers one of these statuses: 499 stands for 400 to 499, 599 for 500 to 599.

                    Default: `[499,599]`.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceHttpStatusCodes:
                  type: string
                  contentMediaType: application/json
                  description: Answers 409 when a file the page loads (a picture, a stylesheet, a script) answers one of these statuses; ranges as for failOnHttpStatusCodes.
                  examples:
                    - "[499,599]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ignoreResourceHttpStatusDomains:
                  type: string
                  contentMediaType: application/json
                  description: "Domains, their subdomains included, that failOnResourceHttpStatusCodes leaves out: [\"sentry-cdn.com\"]."
                  examples:
                    - "[\"example.com\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnResourceLoadingFailed:
                  type: boolean
                  description: |-
                    Answers 409 when a file the page loads cannot be fetched at all.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleExceptions:
                  type: boolean
                  description: |-
                    Answers 409 when the page's script throws an exception.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                failOnConsoleMessageTypes:
                  type: string
                  contentMediaType: application/json
                  description: "Answers 409 when the page writes one of these console types: log, debug, info, warning, error or assert."
                  examples:
                    - "[\"error\"]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitDelay:
                  type: string
                  description: "Waits this long once the page has loaded, before printing: 500ms, 2s."
                  pattern: ^([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+$
                  examples:
                    - "1ms"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForExpression:
                  type: string
                  description: Waits until this JavaScript expression is true, such as `window.ready === true`.
                  examples:
                    - "true"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                waitForSelector:
                  type: string
                  description: Waits until an element matching this CSS selector is on the page, such as `#chart.ready`.
                  examples:
                    - body
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                cookies:
                  type: string
                  contentMediaType: application/json
                  description: "Cookies to set before the page loads: objects with a `name`, a `value` and a `domain`, and optionally a `path`, `secure`, `httpOnly` and `sameSite` (Strict, Lax or None)."
                  examples:
                    - "[{\"name\":\"a\",\"value\":\"b\",\"domain\":\"example.com\"}]"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userAgent:
                  type: string
                  description: The User-Agent header the page's requests send.
                  examples:
                    - kern-tests
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                extraHttpHeaders:
                  type: string
                  contentMediaType: application/json
                  description: "Headers the page's requests send: {\"X-Token\": \"abc\"}. A value ending in `;scope=<regex>` is sent only to the addresses the regex matches."
                  examples:
                    - "{\"X-Test\":\"1\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaType:
                  type: string
                  enum:
                    - print
                    - screen
                  description: |-
                    The CSS media type the page is laid out for.

                    Default: `print`.
                  default: print
                  examples:
                    - print
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                emulatedMediaFeatures:
                  type: string
                  contentMediaType: application/json
                  description: "CSS media features the page sees: {\"prefers-color-scheme\": \"dark\"}."
                  examples:
                    - "{\"prefers-color-scheme\":\"light\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                omitBackground:
                  type: boolean
                  description: |-
                    Leaves out the white background, for a transparent page or picture; a PDF needs printBackground too.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                width:
                  type: integer
                  description: |-
                    The window's width in pixels.

                    Default: `800`.
                  default: 800
                  examples:
                    - 800
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                height:
                  type: integer
                  description: |-
                    The window's height in pixels.

                    Default: `600`.
                  default: 600
                  examples:
                    - 600
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                clip:
                  type: boolean
                  description: |-
                    Takes the window alone, not the whole page.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                selector:
                  type: string
                  description: Takes the first element matching this CSS selector alone.
                  examples:
                    - body
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                format:
                  type: string
                  enum:
                    - png
                    - jpeg
                    - webp
                  description: |-
                    The picture's format (Marqius Kern's --kern-screenshot-format sets another default for the server).

                    Default: `png`.
                  default: png
                  examples:
                    - png
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                quality:
                  type: integer
                  description: |-
                    JPEG and WebP quality, from 0 to 100.

                    Default: `100`.
                  default: 100
                  minimum: 0
                  maximum: 100
                  examples:
                    - 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeForSpeed:
                  type: boolean
                  description: |-
                    Lets Chromium compress faster and larger. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                deviceScaleFactor:
                  type: number
                  description: |-
                    Pixels per CSS pixel: 2 takes a picture twice as wide and tall.

                    Default: `1.0`.
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernBookFeatures:
                  type: boolean
                  description: "Prints what Chromium does not know: running headers (string-set, position: running()), page numbers in contents and cross-references (target-counter), leaders, footnotes (the server's --kern-book-features unless sent)."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFontReport:
                  type: boolean
                  description: Says in the X-Marqius-Kern-Fonts header which fonts each conversion used, their files, and what stood in for what (the server's --kern-font-report unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernRequireFonts:
                  type: string
                  description: "Families this request must have, comma-separated: a conversion that cannot have one is refused (409) instead of printed in another font."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: "Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificatePassword:
                  type: string
                  description: "Opens the store or the key; never logged, never echoed. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignReason:
                  type: string
                  description: "The reason the signature gives (the server's --kern-sign-reason unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignLocation:
                  type: string
                  description: "Where the signature says it was made (the server's --kern-sign-location unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignContactInfo:
                  type: string
                  description: "How to reach the signer (the server's --kern-sign-contact-info unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignName:
                  type: string
                  description: "The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignTimestampUrl:
                  type: string
                  description: "An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignField:
                  type: string
                  description: "Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                waitForWindowStatus:
                  type: string
                  description: Waits until the page sets window.status to this value, before the picture is taken.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: "The picture: PNG, JPEG or WebP, as `format` asks; several as a ZIP."
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            image/png:
              schema:
                type: string
                contentMediaType: image/png
            image/jpeg:
              schema:
                type: string
                contentMediaType: image/jpeg
            image/webp:
              schema:
                type: string
                contentMediaType: image/webp
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "403":
          $ref: "#/components/responses/Status403"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--chromium-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  image/png:
                    schema:
                      type: string
                      contentMediaType: image/png
                  image/jpeg:
                    schema:
                      type: string
                      contentMediaType: image/jpeg
                  image/webp:
                    schema:
                      type: string
                      contentMediaType: image/webp
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body>{{ toHTML "notes.md" }}</body></html>' > index.html
            printf '# Notes\n\n- Agreed on Monday\n- Ships on Friday\n' > notes.md
            curl http://localhost:3000/forms/chromium/screenshot/markdown -F files=@index.html -F files=@notes.md -o notes.png
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body>{{ toHTML "notes.md" }}</body></html>' > index.html
            printf '# Notes\n\n- Agreed on Monday\n- Ships on Friday\n' > notes.md
            marqius-kern run /forms/chromium/screenshot/markdown -F files=@index.html -F files=@notes.md -o notes.png
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body>{{ toHTML \"notes.md\" }}</body></html>")

            with open("notes.md", "w") as f:
                f.write('''# Notes

            - Agreed on Monday
            - Ships on Friday
            ''')

            r = requests.post("http://localhost:3000/forms/chromium/screenshot/markdown", files=[
                ("files", ("index.html", open("index.html", "rb"))),
                ("files", ("notes.md", open("notes.md", "rb"))),
            ])
            r.raise_for_status()
            with open("notes.png", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body>{{ toHTML \"notes.md\" }}</body></html>");

            await writeFile("notes.md", `# Notes

            - Agreed on Monday
            - Ships on Friday
            `);

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              form.append("files", new Blob([await readFile("notes.md")]), "notes.md");
              const res = await fetch("http://localhost:3000/forms/chromium/screenshot/markdown", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("notes.png", Buffer.from(await res.arrayBuffer()));
            }
  /forms/libreoffice/convert:
    post:
      operationId: libreofficeConvert
      summary: Convert Office documents to PDF
      description: Converts Word, Excel, CSV, PowerPoint, OpenDocument, RTF and text files to PDF, laid out as LibreOffice prints them; several are answered as a ZIP unless merged. Off with `--libreoffice-disable-routes`.
      tags:
        - LibreOffice
      x-kern-api:
        - gotenberg-8.40.0
        - gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The documents: Word (.docx, .doc, .docm, .dotx, .dot), Excel (.xlsx, .xls, .xlsm, .xltx, .xlt), CSV and TSV, PowerPoint (.pptx, .pptm, .ppsx, .ppsm, .potx), OpenDocument (.odt, .ods, .odp, their templates and flat files), RTF, plain text and PDF."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                password:
                  type: string
                  description: Opens password-protected documents.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                landscape:
                  type: boolean
                  description: |-
                    Prints the documents on their side.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativePageRanges:
                  type: string
                  description: "The pages to print: 1-4, 2, 1,3,5-7."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                singlePageSheets:
                  type: boolean
                  description: |-
                    Prints each sheet of a workbook whole, on one page of its own size.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                merge:
                  type: boolean
                  description: |-
                    Merges the PDFs into one, in the order of the documents' names.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativePdfFormats:
                  type: boolean
                  description: |-
                    With pdfa or pdfua: made while converting, as LibreOffice does, rather than after.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                generateTaggedPdf:
                  type: boolean
                  description: |-
                    Makes a tagged PDF.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                updateIndexes:
                  type: boolean
                  description: |-
                    Updates the documents' indexes before printing. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportFormFields:
                  type: boolean
                  description: |-
                    Keeps form fields as fields. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                allowDuplicateFieldNames:
                  type: boolean
                  description: |-
                    Lets form fields share a name. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportBookmarks:
                  type: boolean
                  description: |-
                    Makes bookmarks from the headings. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportBookmarksToPdfDestination:
                  type: boolean
                  description: |-
                    Writes the bookmarks as named destinations. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportPlaceholders:
                  type: boolean
                  description: |-
                    Prints placeholder fields' marks. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportNotes:
                  type: boolean
                  description: |-
                    Prints comments as annotations. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportNotesPages:
                  type: boolean
                  description: |-
                    Prints a presentation's notes pages too. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportOnlyNotesPages:
                  type: boolean
                  description: |-
                    Prints a presentation's notes pages alone. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportNotesInMargin:
                  type: boolean
                  description: |-
                    Prints comments in the margin. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                convertOooTargetToPdfTarget:
                  type: boolean
                  description: |-
                    Turns links to other documents into links to their PDFs. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportLinksRelativeFsys:
                  type: boolean
                  description: |-
                    Writes links to files as relative ones. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                exportHiddenSlides:
                  type: boolean
                  description: |-
                    Prints a presentation's hidden slides. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                skipEmptyPages:
                  type: boolean
                  description: |-
                    Leaves out pages with nothing on them. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                addOriginalDocumentAsStream:
                  type: boolean
                  description: |-
                    Carries the document inside its PDF. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                initialView:
                  type: string
                  enum:
                    - "0"
                    - "1"
                    - "2"
                    - default
                    - outline
                    - thumbnails
                  description: |-
                    The PDF viewer's side panel: 0 none, 1 bookmarks, 2 thumbnails (Gotenberg 9's requests: default, outline, thumbnails). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `0`.
                  default: "0"
                  examples:
                    - "0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                initialPage:
                  type: integer
                  description: |-
                    The page the viewer opens at. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `1`.
                  default: 1
                  minimum: 1
                  examples:
                    - 1
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                magnification:
                  type: string
                  enum:
                    - "0"
                    - "1"
                    - "2"
                    - "3"
                    - "4"
                    - default
                    - fitWindow
                    - fitWidth
                    - fitVisible
                    - zoom
                  description: |-
                    The viewer's zoom: 0 default, 1 whole page, 2 page width, 3 window width, 4 zoom (Gotenberg 9's requests: default, fitWindow, fitWidth, fitVisible, zoom). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `0`.
                  default: "0"
                  examples:
                    - "0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                zoom:
                  type: integer
                  description: |-
                    With magnification 4: the zoom in per cent. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `100`.
                  default: 100
                  examples:
                    - 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                pageLayout:
                  type: string
                  enum:
                    - "0"
                    - "1"
                    - "2"
                    - "3"
                    - default
                    - singlePage
                    - oneColumn
                    - twoColumnRight
                  description: |-
                    The viewer's layout: 0 default, 1 one page, 2 one column, 3 two columns (Gotenberg 9's requests: default, singlePage, oneColumn, twoColumnRight). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `0`.
                  default: "0"
                  examples:
                    - "0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                firstPageOnLeft:
                  type: boolean
                  description: |-
                    With two columns: the first page on the left. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                resizeWindowToInitialPage:
                  type: boolean
                  description: |-
                    The viewer's window fitted to the first page. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                centerWindow:
                  type: boolean
                  description: |-
                    The viewer's window centred. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                openInFullScreenMode:
                  type: boolean
                  description: |-
                    The viewer opens full screen. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                displayPDFDocumentTitle:
                  type: boolean
                  description: |-
                    The viewer shows the document's title. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                hideViewerMenubar:
                  type: boolean
                  description: |-
                    The viewer hides its menu bar. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                hideViewerToolbar:
                  type: boolean
                  description: |-
                    The viewer hides its toolbar. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                hideViewerWindowControls:
                  type: boolean
                  description: |-
                    The viewer hides its window controls. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                useTransitionEffects:
                  type: boolean
                  description: |-
                    A presentation's slide transitions. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                openBookmarkLevels:
                  type: integer
                  description: |-
                    The bookmark levels shown open: -1 all, or 1 to 10. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `-1`.
                  default: -1
                  examples:
                    - -1
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                losslessImageCompression:
                  type: boolean
                  description: |-
                    Keeps pictures without loss. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                quality:
                  type: integer
                  description: |-
                    JPEG quality for pictures, 1 to 100. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `90`.
                  default: 90
                  minimum: 1
                  maximum: 100
                  examples:
                    - 90
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                reduceImageResolution:
                  type: boolean
                  description: |-
                    Lowers the pictures' resolution to maxImageResolution. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                maxImageResolution:
                  type: string
                  enum:
                    - "75"
                    - "150"
                    - "300"
                    - "600"
                    - "1200"
                  description: |-
                    With reduceImageResolution: the pictures' highest resolution, in dpi. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `300`.
                  default: "300"
                  examples:
                    - "300"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                nativeWatermarkText:
                  type: string
                  description: "LibreOffice's own watermark: one line drawn across every page, as LibreOffice's PDF export draws it. It wins over nativeTiledWatermarkText. As Gotenberg hands it to LibreOffice, a value holding `=`, or one read as a whole number or as true or false, draws nothing."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativeTiledWatermarkText:
                  type: string
                  description: "LibreOffice's own tiled watermark: the text repeated over every page."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativeWatermarkColor:
                  type: string
                  description: |-
                    The watermark's colour: a number (0xRRGGBB; 0, LibreOffice's own green), or #rrggbb in Gotenberg 9's requests.

                    Default: `8388223`.
                  default: "8388223"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativeWatermarkFontHeight:
                  type: integer
                  description: "The watermark's size, in points; 0 or none: as large as fits."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativeWatermarkRotateAngle:
                  type: integer
                  description: "The watermark's angle, in tenths of a degree, anticlockwise; 0 or none: as the page's shape turns it."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                nativeWatermarkFontName:
                  type: string
                  description: |-
                    The watermark's font (Helvetica is drawn in Liberation Sans, as LibreOffice draws it).

                    Default: `Helvetica`.
                  default: Helvetica
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitMode:
                  type: string
                  enum:
                    - intervals
                    - pages
                  description: "Splits the PDF: `intervals` into parts of splitSpan pages, `pages` into the pages splitSpan names. Several parts are answered as a ZIP."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitSpan:
                  type: string
                  description: "The pages of each part: a number of pages for intervals, page ranges (1-3, 5) for pages."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitUnify:
                  type: boolean
                  description: |-
                    With splitMode pages: the pages chosen in one PDF instead of one PDF each.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                metadata:
                  type: string
                  contentMediaType: application/json
                  description: "The PDF's metadata to write: {\"Author\": \"…\", \"Title\": \"…\", \"Keywords\": [\"…\"]}."
                  examples:
                    - "{\"Title\":\"Marqius Kern\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                flatten:
                  type: boolean
                  description: |-
                    Turns form fields and annotations into the page's own drawing.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts the PDF's restrictions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowPrinting:
                  type: boolean
                  description: |-
                    With a password: printing allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowModifying:
                  type: boolean
                  description: |-
                    With a password: changes allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowCopying:
                  type: boolean
                  description: |-
                    With a password: copying text and pictures allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAnnotating:
                  type: boolean
                  description: |-
                    With a password: comments allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowFillingForms:
                  type: boolean
                  description: |-
                    With a password: filling in forms allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAssembling:
                  type: boolean
                  description: |-
                    With a password: inserting, rotating and deleting pages allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stamp:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn over the pages (stampSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the stamp is: text (stampExpression), or the picture or PDF sent as `stamp`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampExpression:
                  type: string
                  description: The stamp's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampPages:
                  type: string
                  description: "The pages stamped: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampOptions:
                  type: string
                  contentMediaType: application/json
                  description: "How the stamp is drawn: {\"font\": \"Helvetica\", \"fontSize\": 24, \"color\": \"#ff0000\", \"opacity\": 0.5, \"rotation\": 45, \"position\": \"center\"}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermark:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn under the pages' content (watermarkSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the watermark is: text (watermarkExpression), or the picture or PDF sent as `watermark`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkExpression:
                  type: string
                  description: The watermark's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkPages:
                  type: string
                  description: "The pages watermarked: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkOptions:
                  type: string
                  contentMediaType: application/json
                  description: How the watermark is drawn, as for stampOptions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotateAngle:
                  type: string
                  enum:
                    - "90"
                    - "180"
                    - "270"
                  description: Turns the pages by this angle, clockwise.
                  examples:
                    - "90"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotatePages:
                  type: string
                  description: "With rotateAngle: the pages turned: 1-3, 5; all when not given."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeImages:
                  type: boolean
                  description: |-
                    Packs the pictures again as JPEG, for a smaller file.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                imageQuality:
                  type: integer
                  description: "With optimizeImages: the JPEG quality, from 1 to 100."
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernOcr:
                  type: string
                  enum:
                    - "true"
                    - "false"
                    - auto
                  description: |-
                    true (or auto): the pages that need it (scans: little text and a large picture) are read and laid over with hidden text, so the PDF can be searched and copied; the pages look as they did. The summary is in the X-Marqius-Kern-Ocr header.

                    Default: `false`.
                  default: "false"
                  examples:
                    - "false"
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrEngine:
                  type: string
                  description: "The engine that reads: Marqius Kern's own (the server's --kern-ocr-engine unless sent: ppocr-v6-tiny; ppocr-v6-small reads more accurately), tesseract, a folder added with `marqius-kern ocr add`, or an OCR server's name (--kern-ocr-server)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrLanguages:
                  type: string
                  description: "The languages or scripts on the pages, comma-separated (ara, heb, hi, korean...): the default engine is swapped for Marqius Kern's engine that reads them."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrPages:
                  type: string
                  description: "The pages to read if they need it: 1-3,5, even, odd, !1; all unless sent."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrOptional:
                  type: boolean
                  description: |-
                    When OCR cannot run (no engine, a model not fetched yet), the file is answered as it is, with a note, instead of an error.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  enum:
                    - PDF/A-1b
                    - PDF/A-2b
                    - PDF/A-3b
                  description: Makes the PDF this PDF/A level, for archiving.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfua:
                  type: boolean
                  description: |-
                    Makes the PDF accessible (PDF/UA).

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embeds:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: Files carried inside the PDF as attachments.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embedsMetadata:
                  type: string
                  contentMediaType: application/json
                  description: "For each file carried inside, by its name: {\"invoice.xml\": {\"mimeType\": \"text/xml\", \"relationship\": \"Data\"}}."
                  examples:
                    - "{\"note.txt\":{\"mimeType\":\"text/plain\"}}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxXml:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "A Factur-X or ZUGFeRD invoice's XML: the PDF is made an e-invoice carrying it (PDF/A-3b)."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxVersion:
                  type: string
                  description: |-
                    The Factur-X version written in the PDF's metadata.

                    Default: `1.0`.
                  default: "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxConformanceLevel:
                  type: string
                  enum:
                    - MINIMUM
                    - BASIC WL
                    - BASIC
                    - EN 16931
                    - EXTENDED
                    - XRECHNUNG
                  description: The invoice XML's profile, when the XML does not say it.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxDocumentType:
                  type: string
                  enum:
                    - INVOICE
                    - ORDER
                    - ORDER_RESPONSE
                    - ORDER_CHANGE
                  description: What the XML is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                singlePage:
                  type: boolean
                  description: |-
                    Gotenberg 9's name for singlePageSheets, taken here too on a server answering 8.x alone, --kern-api=8 (a value that is not a boolean is passed over, as Gotenberg 8 passes over a field it does not know); on a server answering both, it makes the request 9.x's.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                kernContents:
                  type: boolean
                  description: |-
                    A contents page is made on the Chromium routes alone. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: noted
                kernData:
                  type: string
                  contentMediaType: application/json
                  description: JSON that the Word files are filled from before they are converted ({{ customer.name }}, formats, loops and conditions); an array of objects makes a document for each record.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernDataStrict:
                  type: boolean
                  description: |-
                    With kernData: a field a record does not have is refused rather than left empty.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFirstPageNumber:
                  type: integer
                  description: |-
                    The number the first page is given; the rest count on from it.

                    Default: `1`.
                  default: 1
                  examples:
                    - 1
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernFontReport:
                  type: boolean
                  description: Says in the X-Marqius-Kern-Fonts header which fonts each conversion used, their files, and what stood in for what (the server's --kern-font-report unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernRequireFonts:
                  type: string
                  description: "Families this request must have, comma-separated: a conversion that cannot have one is refused (409) instead of printed in another font."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                stages:
                  type: string
                  contentMediaType: application/json
                  description: "Operations run on the PDFs in order, each with its options as /forms/pdf's routes take them: a JSON array such as [{\"op\":\"set-metadata\",\"title\":\"Report\"},{\"op\":\"encrypt\",\"userPassword\":\"open\"}]."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                locale:
                  type: string
                  description: "The language the documents are laid out in, as a BCP 47 tag such as en-AU or de-DE: dates, numbers and hyphenation follow it."
                  pattern: ^[A-Za-z]{2,3}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?$
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                paperSize:
                  type: string
                  description: A paper by name, such as A4 or Letter, for the documents' pages.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                paperWidth:
                  type: string
                  description: The paper's width for the documents' pages.
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                paperHeight:
                  type: string
                  description: The paper's height for the documents' pages.
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativePages:
                  type: string
                  description: "The pages to print: 1-4, 2, 1,3,5-7 (Gotenberg 9's name for nativePageRanges)."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                showTrackedChanges:
                  type: boolean
                  description: |-
                    Prints a document's tracked changes, marked up.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeBookmarks:
                  type: boolean
                  description: |-
                    Makes bookmarks from the headings (Gotenberg 9's name for exportBookmarks).

                    Default: `true`.
                  default: true
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeTaggedPdf:
                  type: boolean
                  description: |-
                    Makes a tagged PDF (Gotenberg 9's name for generateTaggedPdf).

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeQuality:
                  type: integer
                  description: |-
                    JPEG quality for pictures, from 1 to 100 (Gotenberg 9's name for quality).

                    Default: `90`.
                  default: 90
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeLosslessImageCompression:
                  type: boolean
                  description: |-
                    Keeps pictures without loss (Gotenberg 9's name for losslessImageCompression).

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeReduceImageResolution:
                  type: boolean
                  description: |-
                    Lowers the pictures' resolution to nativeMaxImageResolution.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeMaxImageResolution:
                  type: string
                  enum:
                    - "75"
                    - "150"
                    - "300"
                    - "600"
                    - "1200"
                  description: |-
                    With nativeReduceImageResolution: the pictures' highest resolution, in dpi.

                    Default: `300`.
                  default: "300"
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeWatermarkFontSize:
                  type: integer
                  description: "LibreOffice's own watermark: its size in points (Gotenberg 9's name for nativeWatermarkFontHeight)."
                  minimum: 0
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeWatermarkRotation:
                  type: number
                  description: "LibreOffice's own watermark: its angle, in degrees."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativeWatermarkFont:
                  type: string
                  description: |-
                    LibreOffice's own watermark: its font (Gotenberg 9's name for nativeWatermarkFontName).

                    Default: `Helvetica`.
                  default: Helvetica
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativePdfa:
                  type: string
                  enum:
                    - PDF/A-1b
                    - PDF/A-2b
                    - PDF/A-3b
                    - PDF/A-4
                  description: Makes the PDF this PDF/A level as LibreOffice exports it (Gotenberg 9's name for pdfa).
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                nativePdfua:
                  type: string
                  enum:
                    - PDF/UA-1
                  description: Makes the PDF accessible as LibreOffice exports it; PDF/UA-2 comes from a remediate stage.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
              required:
                - files
            encoding:
              stampSource:
                explode: true
              stampExpression:
                explode: true
              stampPages:
                explode: true
              stampOptions:
                explode: true
              watermarkSource:
                explode: true
              watermarkExpression:
                explode: true
              watermarkPages:
                explode: true
              watermarkOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--libreoffice-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf 'Name,Units,Price\nPaper,3,4.50\nInk,1,12.00\n' > order.csv
            curl http://localhost:3000/forms/libreoffice/convert -F files=@order.csv -o order.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf 'Name,Units,Price\nPaper,3,4.50\nInk,1,12.00\n' > order.csv
            marqius-kern run /forms/libreoffice/convert -F files=@order.csv -o order.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("order.csv", "w") as f:
                f.write('''Name,Units,Price
            Paper,3,4.50
            Ink,1,12.00
            ''')

            r = requests.post("http://localhost:3000/forms/libreoffice/convert", files=[
                ("files", ("order.csv", open("order.csv", "rb"))),
            ])
            r.raise_for_status()
            with open("order.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("order.csv", `Name,Units,Price
            Paper,3,4.50
            Ink,1,12.00
            `);

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("order.csv")]), "order.csv");
              const res = await fetch("http://localhost:3000/forms/libreoffice/convert", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("order.pdf", Buffer.from(await res.arrayBuffer()));
            }
        - lang: Shell
          label: curl (Gotenberg 9's fields)
          source: |-
            printf 'Name,Units,Price\nPaper,3,4.50\nInk,1,12.00\n' > order.csv
            curl http://localhost:3000/forms/libreoffice/convert -F files=@order.csv -F nativePages=1 -F 'stages=[{"op":"set-metadata","title":"Order"}]' -o order.pdf
        - lang: Shell
          label: marqius-kern run (Gotenberg 9's fields), no server
          source: |-
            printf 'Name,Units,Price\nPaper,3,4.50\nInk,1,12.00\n' > order.csv
            marqius-kern run /forms/libreoffice/convert -F files=@order.csv -F nativePages=1 -F 'stages=[{"op":"set-metadata","title":"Order"}]' -o order.pdf
        - lang: Python
          label: Python (Gotenberg 9's fields)
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("order.csv", "w") as f:
                f.write('''Name,Units,Price
            Paper,3,4.50
            Ink,1,12.00
            ''')

            r = requests.post("http://localhost:3000/forms/libreoffice/convert", files=[
                ("files", ("order.csv", open("order.csv", "rb"))),
                ("nativePages", (None, "1")),
                ("stages", (None, "[{\"op\":\"set-metadata\",\"title\":\"Order\"}]")),
            ])
            r.raise_for_status()
            with open("order.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript (Gotenberg 9's fields)
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("order.csv", `Name,Units,Price
            Paper,3,4.50
            Ink,1,12.00
            `);

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("order.csv")]), "order.csv");
              form.append("nativePages", "1");
              form.append("stages", "[{\"op\":\"set-metadata\",\"title\":\"Order\"}]");
              const res = await fetch("http://localhost:3000/forms/libreoffice/convert", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("order.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/merge:
    post:
      operationId: pdfenginesMerge
      summary: Merge PDFs
      description: Merges PDFs into one, in the order of their names. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs, merged in the order of their names.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                autoIndexBookmarks:
                  type: boolean
                  description: |-
                    Numbers each PDF's bookmarks under it.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                titleBookmarks:
                  type: boolean
                  description: |-
                    A bookmark for each PDF, named after its title or file.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                bookmarks:
                  type: string
                  contentMediaType: application/json
                  description: "Bookmarks for the merged PDF, by the name of the file whose pages they point into: {\"a.pdf\": [{\"title\": \"…\", \"page\": 1, \"children\": [...]}]}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitMode:
                  type: string
                  enum:
                    - intervals
                    - pages
                  description: Read with the other fields; the merge route does not split. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                splitSpan:
                  type: string
                  description: Read with the other fields; the merge route does not split. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                splitUnify:
                  type: boolean
                  description: |-
                    Read with the other fields; the merge route does not split. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                metadata:
                  type: string
                  contentMediaType: application/json
                  description: "The PDF's metadata to write: {\"Author\": \"…\", \"Title\": \"…\", \"Keywords\": [\"…\"]}."
                  examples:
                    - "{\"Title\":\"Marqius Kern\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                flatten:
                  type: boolean
                  description: |-
                    Turns form fields and annotations into the page's own drawing.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts the PDF's restrictions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowPrinting:
                  type: boolean
                  description: |-
                    With a password: printing allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowModifying:
                  type: boolean
                  description: |-
                    With a password: changes allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowCopying:
                  type: boolean
                  description: |-
                    With a password: copying text and pictures allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAnnotating:
                  type: boolean
                  description: |-
                    With a password: comments allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowFillingForms:
                  type: boolean
                  description: |-
                    With a password: filling in forms allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAssembling:
                  type: boolean
                  description: |-
                    With a password: inserting, rotating and deleting pages allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stamp:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn over the pages (stampSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the stamp is: text (stampExpression), or the picture or PDF sent as `stamp`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampExpression:
                  type: string
                  description: The stamp's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampPages:
                  type: string
                  description: "The pages stamped: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampOptions:
                  type: string
                  contentMediaType: application/json
                  description: "How the stamp is drawn: {\"font\": \"Helvetica\", \"fontSize\": 24, \"color\": \"#ff0000\", \"opacity\": 0.5, \"rotation\": 45, \"position\": \"center\"}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermark:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn under the pages' content (watermarkSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the watermark is: text (watermarkExpression), or the picture or PDF sent as `watermark`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkExpression:
                  type: string
                  description: The watermark's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkPages:
                  type: string
                  description: "The pages watermarked: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkOptions:
                  type: string
                  contentMediaType: application/json
                  description: How the watermark is drawn, as for stampOptions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotateAngle:
                  type: string
                  enum:
                    - "90"
                    - "180"
                    - "270"
                  description: Turns the pages by this angle, clockwise.
                  examples:
                    - "90"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotatePages:
                  type: string
                  description: "With rotateAngle: the pages turned: 1-3, 5; all when not given."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeImages:
                  type: boolean
                  description: |-
                    Packs the pictures again as JPEG, for a smaller file.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                imageQuality:
                  type: integer
                  description: "With optimizeImages: the JPEG quality, from 1 to 100."
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernOcr:
                  type: string
                  enum:
                    - "true"
                    - "false"
                    - auto
                  description: |-
                    true (or auto): the pages that need it (scans: little text and a large picture) are read and laid over with hidden text, so the PDF can be searched and copied; the pages look as they did. The summary is in the X-Marqius-Kern-Ocr header.

                    Default: `false`.
                  default: "false"
                  examples:
                    - "false"
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrEngine:
                  type: string
                  description: "The engine that reads: Marqius Kern's own (the server's --kern-ocr-engine unless sent: ppocr-v6-tiny; ppocr-v6-small reads more accurately), tesseract, a folder added with `marqius-kern ocr add`, or an OCR server's name (--kern-ocr-server)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrLanguages:
                  type: string
                  description: "The languages or scripts on the pages, comma-separated (ara, heb, hi, korean...): the default engine is swapped for Marqius Kern's engine that reads them."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrPages:
                  type: string
                  description: "The pages to read if they need it: 1-3,5, even, odd, !1; all unless sent."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrOptional:
                  type: boolean
                  description: |-
                    When OCR cannot run (no engine, a model not fetched yet), the file is answered as it is, with a note, instead of an error.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  enum:
                    - PDF/A-1b
                    - PDF/A-2b
                    - PDF/A-3b
                  description: Makes the PDF this PDF/A level, for archiving.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfua:
                  type: boolean
                  description: |-
                    Makes the PDF accessible (PDF/UA).

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embeds:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: Files carried inside the PDF as attachments.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embedsMetadata:
                  type: string
                  contentMediaType: application/json
                  description: "For each file carried inside, by its name: {\"invoice.xml\": {\"mimeType\": \"text/xml\", \"relationship\": \"Data\"}}."
                  examples:
                    - "{\"note.txt\":{\"mimeType\":\"text/plain\"}}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxXml:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "A Factur-X or ZUGFeRD invoice's XML: the PDF is made an e-invoice carrying it (PDF/A-3b)."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxVersion:
                  type: string
                  description: |-
                    The Factur-X version written in the PDF's metadata.

                    Default: `1.0`.
                  default: "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxConformanceLevel:
                  type: string
                  enum:
                    - MINIMUM
                    - BASIC WL
                    - BASIC
                    - EN 16931
                    - EXTENDED
                    - XRECHNUNG
                  description: The invoice XML's profile, when the XML does not say it.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxDocumentType:
                  type: string
                  enum:
                    - INVOICE
                    - ORDER
                    - ORDER_RESPONSE
                    - ORDER_CHANGE
                  description: What the XML is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
            encoding:
              stampSource:
                explode: true
              stampExpression:
                explode: true
              stampPages:
                explode: true
              stampOptions:
                explode: true
              watermarkSource:
                explode: true
              watermarkExpression:
                explode: true
              watermarkPages:
                explode: true
              watermarkOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            mkdir -p cover && printf '<!doctype html><html><body style="background: #0b3d91"><h1 style="color: white">Cover</h1></body></html>' > cover/index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@cover/index.html -F printBackground=true -o cover.pdf
            curl http://localhost:3000/forms/pdfengines/merge -F files=@cover.pdf -F files=@a.pdf -o merged.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            mkdir -p cover && printf '<!doctype html><html><body style="background: #0b3d91"><h1 style="color: white">Cover</h1></body></html>' > cover/index.html
            marqius-kern run /forms/chromium/convert/html -F files=@cover/index.html -F printBackground=true -o cover.pdf
            marqius-kern run /forms/pdfengines/merge -F files=@cover.pdf -F files=@a.pdf -o merged.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import os
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            os.makedirs("cover", exist_ok=True)

            with open("cover/index.html", "w") as f:
                f.write("<!doctype html><html><body style=\"background: #0b3d91\"><h1 style=\"color: white\">Cover</h1></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("cover/index.html", "rb"))),
                ("printBackground", (None, "true")),
            ])
            r.raise_for_status()
            with open("cover.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/merge", files=[
                ("files", ("cover.pdf", open("cover.pdf", "rb"))),
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("merged.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { mkdir, readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await mkdir("cover", { recursive: true });

            await writeFile("cover/index.html", "<!doctype html><html><body style=\"background: #0b3d91\"><h1 style=\"color: white\">Cover</h1></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("cover/index.html")]), "index.html");
              form.append("printBackground", "true");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("cover.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("cover.pdf")]), "cover.pdf");
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/pdfengines/merge", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("merged.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/split:
    post:
      operationId: pdfenginesSplit
      summary: Split PDFs
      description: Splits each PDF into parts. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitMode:
                  type: string
                  enum:
                    - intervals
                    - pages
                  description: "intervals: parts of splitSpan pages; pages: the pages splitSpan names."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitSpan:
                  type: string
                  description: A number of pages for intervals, page ranges for pages.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitUnify:
                  type: boolean
                  description: |-
                    With pages: the pages chosen in one PDF.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                metadata:
                  type: string
                  contentMediaType: application/json
                  description: "The PDF's metadata to write: {\"Author\": \"…\", \"Title\": \"…\", \"Keywords\": [\"…\"]}."
                  examples:
                    - "{\"Title\":\"Marqius Kern\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                flatten:
                  type: boolean
                  description: |-
                    Turns form fields and annotations into the page's own drawing.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts the PDF's restrictions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowPrinting:
                  type: boolean
                  description: |-
                    With a password: printing allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowModifying:
                  type: boolean
                  description: |-
                    With a password: changes allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowCopying:
                  type: boolean
                  description: |-
                    With a password: copying text and pictures allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAnnotating:
                  type: boolean
                  description: |-
                    With a password: comments allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowFillingForms:
                  type: boolean
                  description: |-
                    With a password: filling in forms allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAssembling:
                  type: boolean
                  description: |-
                    With a password: inserting, rotating and deleting pages allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stamp:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn over the pages (stampSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the stamp is: text (stampExpression), or the picture or PDF sent as `stamp`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampExpression:
                  type: string
                  description: The stamp's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampPages:
                  type: string
                  description: "The pages stamped: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampOptions:
                  type: string
                  contentMediaType: application/json
                  description: "How the stamp is drawn: {\"font\": \"Helvetica\", \"fontSize\": 24, \"color\": \"#ff0000\", \"opacity\": 0.5, \"rotation\": 45, \"position\": \"center\"}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermark:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn under the pages' content (watermarkSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the watermark is: text (watermarkExpression), or the picture or PDF sent as `watermark`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkExpression:
                  type: string
                  description: The watermark's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkPages:
                  type: string
                  description: "The pages watermarked: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkOptions:
                  type: string
                  contentMediaType: application/json
                  description: How the watermark is drawn, as for stampOptions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotateAngle:
                  type: string
                  enum:
                    - "90"
                    - "180"
                    - "270"
                  description: Turns the pages by this angle, clockwise.
                  examples:
                    - "90"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotatePages:
                  type: string
                  description: "With rotateAngle: the pages turned: 1-3, 5; all when not given."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeImages:
                  type: boolean
                  description: |-
                    Packs the pictures again as JPEG, for a smaller file.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                imageQuality:
                  type: integer
                  description: "With optimizeImages: the JPEG quality, from 1 to 100."
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernOcr:
                  type: string
                  enum:
                    - "true"
                    - "false"
                    - auto
                  description: |-
                    true (or auto): the pages that need it (scans: little text and a large picture) are read and laid over with hidden text, so the PDF can be searched and copied; the pages look as they did. The summary is in the X-Marqius-Kern-Ocr header.

                    Default: `false`.
                  default: "false"
                  examples:
                    - "false"
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrEngine:
                  type: string
                  description: "The engine that reads: Marqius Kern's own (the server's --kern-ocr-engine unless sent: ppocr-v6-tiny; ppocr-v6-small reads more accurately), tesseract, a folder added with `marqius-kern ocr add`, or an OCR server's name (--kern-ocr-server)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrLanguages:
                  type: string
                  description: "The languages or scripts on the pages, comma-separated (ara, heb, hi, korean...): the default engine is swapped for Marqius Kern's engine that reads them."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrPages:
                  type: string
                  description: "The pages to read if they need it: 1-3,5, even, odd, !1; all unless sent."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrOptional:
                  type: boolean
                  description: |-
                    When OCR cannot run (no engine, a model not fetched yet), the file is answered as it is, with a note, instead of an error.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  enum:
                    - PDF/A-1b
                    - PDF/A-2b
                    - PDF/A-3b
                  description: Makes the PDF this PDF/A level, for archiving.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfua:
                  type: boolean
                  description: |-
                    Makes the PDF accessible (PDF/UA).

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embeds:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: Files carried inside the PDF as attachments.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embedsMetadata:
                  type: string
                  contentMediaType: application/json
                  description: "For each file carried inside, by its name: {\"invoice.xml\": {\"mimeType\": \"text/xml\", \"relationship\": \"Data\"}}."
                  examples:
                    - "{\"note.txt\":{\"mimeType\":\"text/plain\"}}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxXml:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "A Factur-X or ZUGFeRD invoice's XML: the PDF is made an e-invoice carrying it (PDF/A-3b)."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxVersion:
                  type: string
                  description: |-
                    The Factur-X version written in the PDF's metadata.

                    Default: `1.0`.
                  default: "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxConformanceLevel:
                  type: string
                  enum:
                    - MINIMUM
                    - BASIC WL
                    - BASIC
                    - EN 16931
                    - EXTENDED
                    - XRECHNUNG
                  description: The invoice XML's profile, when the XML does not say it.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxDocumentType:
                  type: string
                  enum:
                    - INVOICE
                    - ORDER
                    - ORDER_RESPONSE
                    - ORDER_CHANGE
                  description: What the XML is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - splitMode
                - splitSpan
            encoding:
              stampSource:
                explode: true
              stampExpression:
                explode: true
              stampPages:
                explode: true
              stampOptions:
                explode: true
              watermarkSource:
                explode: true
              watermarkExpression:
                explode: true
              watermarkPages:
                explode: true
              watermarkOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            mkdir -p three && printf '<!doctype html><html><body><h1 style="break-after: page">One</h1><h1 style="break-after: page">Two</h1><h1>Three</h1></body></html>' > three/index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@three/index.html -o pages.pdf
            curl http://localhost:3000/forms/pdfengines/split -F files=@pages.pdf -F splitMode=intervals -F splitSpan=1 -o parts.zip
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            mkdir -p three && printf '<!doctype html><html><body><h1 style="break-after: page">One</h1><h1 style="break-after: page">Two</h1><h1>Three</h1></body></html>' > three/index.html
            marqius-kern run /forms/chromium/convert/html -F files=@three/index.html -o pages.pdf
            marqius-kern run /forms/pdfengines/split -F files=@pages.pdf -F splitMode=intervals -F splitSpan=1 -o parts.zip
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import os
            import requests

            os.makedirs("three", exist_ok=True)

            with open("three/index.html", "w") as f:
                f.write("<!doctype html><html><body><h1 style=\"break-after: page\">One</h1><h1 style=\"break-after: page\">Two</h1><h1>Three</h1></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("three/index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("pages.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/split", files=[
                ("files", ("pages.pdf", open("pages.pdf", "rb"))),
                ("splitMode", (None, "intervals")),
                ("splitSpan", (None, "1")),
            ])
            r.raise_for_status()
            with open("parts.zip", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { mkdir, readFile, writeFile } from "node:fs/promises";

            await mkdir("three", { recursive: true });

            await writeFile("three/index.html", "<!doctype html><html><body><h1 style=\"break-after: page\">One</h1><h1 style=\"break-after: page\">Two</h1><h1>Three</h1></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("three/index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("pages.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("pages.pdf")]), "pages.pdf");
              form.append("splitMode", "intervals");
              form.append("splitSpan", "1");
              const res = await fetch("http://localhost:3000/forms/pdfengines/split", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("parts.zip", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/flatten:
    post:
      operationId: pdfenginesFlatten
      summary: Flatten PDFs
      description: Turns form fields and annotations into the pages' own drawing. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: "cat > form.pdf <<'PDF'\n%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\nPDF\ncurl http://localhost:3000/forms/pdfengines/flatten -F files=@form.pdf -o flat.pdf"
        - lang: Shell
          label: marqius-kern run, no server
          source: "cat > form.pdf <<'PDF'\n%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\nPDF\nmarqius-kern run /forms/pdfengines/flatten -F files=@form.pdf -o flat.pdf"
        - lang: Python
          label: Python
          source: "# Python 3 with requests (pip install requests)\nimport requests\n\nwith open(\"form.pdf\", \"w\") as f:\n    f.write('''%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\n''')\n\nr = requests.post(\"http://localhost:3000/forms/pdfengines/flatten\", files=[\n    (\"files\", (\"form.pdf\", open(\"form.pdf\", \"rb\"))),\n])\nr.raise_for_status()\nwith open(\"flat.pdf\", \"wb\") as f:\n    f.write(r.content)"
        - lang: JavaScript
          label: JavaScript
          source: "// Node 18 or later: save as sample.mjs, then run node sample.mjs\nimport { readFile, writeFile } from \"node:fs/promises\";\n\nawait writeFile(\"form.pdf\", `%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\n`);\n\n{\n  const form = new FormData();\n  form.append(\"files\", new Blob([await readFile(\"form.pdf\")]), \"form.pdf\");\n  const res = await fetch(\"http://localhost:3000/forms/pdfengines/flatten\", { method: \"POST\", body: form });\n  if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);\n  await writeFile(\"flat.pdf\", Buffer.from(await res.arrayBuffer()));\n}"
  /forms/pdfengines/optimize:
    post:
      operationId: pdfenginesOptimize
      summary: Optimise PDFs
      description: "Makes PDFs smaller: pictures packed again as JPEG when asked. Off with `--pdfengines-disable-routes`."
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs, their pictures packed again as JPEG.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeImages:
                  type: boolean
                  description: |-
                    Read as true or false, as Gotenberg 8.40.0's form reads it (anything else is refused); the route packs the pictures either way, as 8.40.0's does. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                imageQuality:
                  type: integer
                  description: The JPEG quality, from 1 to 100.
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/optimize -F files=@a.pdf -F imageQuality=80 -o small.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/optimize -F files=@a.pdf -F imageQuality=80 -o small.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/optimize", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("imageQuality", (None, "80")),
            ])
            r.raise_for_status()
            with open("small.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("imageQuality", "80");
              const res = await fetch("http://localhost:3000/forms/pdfengines/optimize", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("small.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/convert:
    post:
      operationId: pdfenginesConvert
      summary: Make PDFs PDF/A or PDF/UA
      description: Makes PDFs a PDF/A level, accessible (PDF/UA), or both. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  enum:
                    - PDF/A-1b
                    - PDF/A-2b
                    - PDF/A-3b
                  description: The PDF/A level.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfua:
                  type: boolean
                  description: |-
                    Makes the PDFs accessible (PDF/UA).

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/convert -F files=@a.pdf -F pdfa=PDF/A-2b -o archive.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/convert -F files=@a.pdf -F pdfa=PDF/A-2b -o archive.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/convert", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("pdfa", (None, "PDF/A-2b")),
            ])
            r.raise_for_status()
            with open("archive.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("pdfa", "PDF/A-2b");
              const res = await fetch("http://localhost:3000/forms/pdfengines/convert", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("archive.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/rotate:
    post:
      operationId: pdfenginesRotate
      summary: Rotate pages
      description: Turns pages by 90, 180 or 270 degrees. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotateAngle:
                  type: string
                  enum:
                    - "90"
                    - "180"
                    - "270"
                  description: The angle, clockwise.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotatePages:
                  type: string
                  description: "The pages turned: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - rotateAngle
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/rotate -F files=@a.pdf -F rotateAngle=90 -o turned.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/rotate -F files=@a.pdf -F rotateAngle=90 -o turned.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/rotate", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("rotateAngle", (None, "90")),
            ])
            r.raise_for_status()
            with open("turned.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("rotateAngle", "90");
              const res = await fetch("http://localhost:3000/forms/pdfengines/rotate", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("turned.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/encrypt:
    post:
      operationId: pdfenginesEncrypt
      summary: Protect PDFs with a password
      description: Sets the passwords that open a PDF and lift its restrictions, and what is allowed. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts its restrictions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowPrinting:
                  type: boolean
                  description: |-
                    Printing allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowModifying:
                  type: boolean
                  description: |-
                    Changes allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowCopying:
                  type: boolean
                  description: |-
                    Copying allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAnnotating:
                  type: boolean
                  description: |-
                    Comments allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowFillingForms:
                  type: boolean
                  description: |-
                    Filling in forms allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAssembling:
                  type: boolean
                  description: |-
                    Changing pages allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - userPassword
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/encrypt -F files=@a.pdf -F userPassword=open -o locked.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/encrypt -F files=@a.pdf -F userPassword=open -o locked.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/encrypt", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("userPassword", (None, "open")),
            ])
            r.raise_for_status()
            with open("locked.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("userPassword", "open");
              const res = await fetch("http://localhost:3000/forms/pdfengines/encrypt", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("locked.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/embed:
    post:
      operationId: pdfenginesEmbed
      summary: Carry files inside PDFs
      description: Carries files inside each PDF as attachments. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embeds:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The files carried inside each PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                embedsMetadata:
                  type: string
                  contentMediaType: application/json
                  description: "For each file carried inside, by its name: its mimeType and relationship."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxXml:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A Factur-X or ZUGFeRD invoice's XML, carried as the e-invoice (with facturxConformanceLevel).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxVersion:
                  type: string
                  description: |-
                    The Factur-X version written.

                    Default: `1.0`.
                  default: "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxConformanceLevel:
                  type: string
                  enum:
                    - MINIMUM
                    - BASIC WL
                    - BASIC
                    - EN 16931
                    - EXTENDED
                    - XRECHNUNG
                  description: The XML's profile.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxDocumentType:
                  type: string
                  enum:
                    - INVOICE
                    - ORDER
                    - ORDER_RESPONSE
                    - ORDER_CHANGE
                  description: What the XML is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - embeds
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            curl http://localhost:3000/forms/pdfengines/embed -F files=@a.pdf -F embeds=@note.txt -o with-note.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            marqius-kern run /forms/pdfengines/embed -F files=@a.pdf -F embeds=@note.txt -o with-note.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            with open("note.txt", "w") as f:
                f.write("Shipped on Friday.\n")

            r = requests.post("http://localhost:3000/forms/pdfengines/embed", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("embeds", ("note.txt", open("note.txt", "rb"))),
            ])
            r.raise_for_status()
            with open("with-note.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await writeFile("note.txt", "Shipped on Friday.\n");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("embeds", new Blob([await readFile("note.txt")]), "note.txt");
              const res = await fetch("http://localhost:3000/forms/pdfengines/embed", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("with-note.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/factur-x:
    post:
      operationId: pdfenginesFacturX
      summary: Make PDFs Factur-X invoices
      description: Makes each PDF a Factur-X / ZUGFeRD e-invoice carrying the XML sent. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxXml:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The invoice's XML.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxVersion:
                  type: string
                  description: |-
                    The Factur-X version written.

                    Default: `1.0`.
                  default: "1.0"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxConformanceLevel:
                  type: string
                  enum:
                    - MINIMUM
                    - BASIC WL
                    - BASIC
                    - EN 16931
                    - EXTENDED
                    - XRECHNUNG
                  description: The XML's profile, when it does not say it.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                facturxDocumentType:
                  type: string
                  enum:
                    - INVOICE
                    - ORDER
                    - ORDER_RESPONSE
                    - ORDER_CHANGE
                  description: What the XML is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  enum:
                    - PDF/A-3b
                  description: PDF/A-3b, which Factur-X asks for.
                  examples:
                    - PDF/A-3b
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                pdfua:
                  type: boolean
                  description: |-
                    Makes the PDFs accessible too.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: "Read only to refuse it: a PDF/A file, which a Factur-X invoice is, is never locked with a password. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - facturxXml
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o invoice-print.pdf
            cat > invoice.xml <<'XML'
            <?xml version="1.0" encoding="UTF-8"?>
            <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
              <rsm:ExchangedDocumentContext>
                <ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter>
              </rsm:ExchangedDocumentContext>
              <rsm:ExchangedDocument>
                <ram:ID>INV-2026-001</ram:ID>
                <ram:TypeCode>380</ram:TypeCode>
                <ram:IssueDateTime><udt:DateTimeString format="102">20261130</udt:DateTimeString></ram:IssueDateTime>
              </rsm:ExchangedDocument>
              <rsm:SupplyChainTradeTransaction>
                <ram:ApplicableHeaderTradeAgreement>
                  <ram:SellerTradeParty>
                    <ram:Name>Example Ltd</ram:Name>
                    <ram:SpecifiedLegalOrganization><ram:ID>123456789</ram:ID></ram:SpecifiedLegalOrganization>
                    <ram:PostalTradeAddress><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
                    <ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">FR32123456789</ram:ID></ram:SpecifiedTaxRegistration>
                  </ram:SellerTradeParty>
                  <ram:BuyerTradeParty><ram:Name>Client SA</ram:Name></ram:BuyerTradeParty>
                </ram:ApplicableHeaderTradeAgreement>
                <ram:ApplicableHeaderTradeDelivery/>
                <ram:ApplicableHeaderTradeSettlement>
                  <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
                  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                    <ram:TaxBasisTotalAmount>100.00</ram:TaxBasisTotalAmount>
                    <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
                    <ram:GrandTotalAmount>120.00</ram:GrandTotalAmount>
                    <ram:DuePayableAmount>120.00</ram:DuePayableAmount>
                  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                </ram:ApplicableHeaderTradeSettlement>
              </rsm:SupplyChainTradeTransaction>
            </rsm:CrossIndustryInvoice>
            XML
            curl http://localhost:3000/forms/pdfengines/factur-x -F files=@invoice-print.pdf -F facturxXml=@invoice.xml -F facturxConformanceLevel=MINIMUM -o invoice.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o invoice-print.pdf
            cat > invoice.xml <<'XML'
            <?xml version="1.0" encoding="UTF-8"?>
            <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
              <rsm:ExchangedDocumentContext>
                <ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter>
              </rsm:ExchangedDocumentContext>
              <rsm:ExchangedDocument>
                <ram:ID>INV-2026-001</ram:ID>
                <ram:TypeCode>380</ram:TypeCode>
                <ram:IssueDateTime><udt:DateTimeString format="102">20261130</udt:DateTimeString></ram:IssueDateTime>
              </rsm:ExchangedDocument>
              <rsm:SupplyChainTradeTransaction>
                <ram:ApplicableHeaderTradeAgreement>
                  <ram:SellerTradeParty>
                    <ram:Name>Example Ltd</ram:Name>
                    <ram:SpecifiedLegalOrganization><ram:ID>123456789</ram:ID></ram:SpecifiedLegalOrganization>
                    <ram:PostalTradeAddress><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
                    <ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">FR32123456789</ram:ID></ram:SpecifiedTaxRegistration>
                  </ram:SellerTradeParty>
                  <ram:BuyerTradeParty><ram:Name>Client SA</ram:Name></ram:BuyerTradeParty>
                </ram:ApplicableHeaderTradeAgreement>
                <ram:ApplicableHeaderTradeDelivery/>
                <ram:ApplicableHeaderTradeSettlement>
                  <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
                  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                    <ram:TaxBasisTotalAmount>100.00</ram:TaxBasisTotalAmount>
                    <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
                    <ram:GrandTotalAmount>120.00</ram:GrandTotalAmount>
                    <ram:DuePayableAmount>120.00</ram:DuePayableAmount>
                  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                </ram:ApplicableHeaderTradeSettlement>
              </rsm:SupplyChainTradeTransaction>
            </rsm:CrossIndustryInvoice>
            XML
            marqius-kern run /forms/pdfengines/factur-x -F files=@invoice-print.pdf -F facturxXml=@invoice.xml -F facturxConformanceLevel=MINIMUM -o invoice.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("invoice-print.pdf", "wb") as f:
                f.write(r.content)

            with open("invoice.xml", "w") as f:
                f.write('''<?xml version="1.0" encoding="UTF-8"?>
            <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
              <rsm:ExchangedDocumentContext>
                <ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter>
              </rsm:ExchangedDocumentContext>
              <rsm:ExchangedDocument>
                <ram:ID>INV-2026-001</ram:ID>
                <ram:TypeCode>380</ram:TypeCode>
                <ram:IssueDateTime><udt:DateTimeString format="102">20261130</udt:DateTimeString></ram:IssueDateTime>
              </rsm:ExchangedDocument>
              <rsm:SupplyChainTradeTransaction>
                <ram:ApplicableHeaderTradeAgreement>
                  <ram:SellerTradeParty>
                    <ram:Name>Example Ltd</ram:Name>
                    <ram:SpecifiedLegalOrganization><ram:ID>123456789</ram:ID></ram:SpecifiedLegalOrganization>
                    <ram:PostalTradeAddress><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
                    <ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">FR32123456789</ram:ID></ram:SpecifiedTaxRegistration>
                  </ram:SellerTradeParty>
                  <ram:BuyerTradeParty><ram:Name>Client SA</ram:Name></ram:BuyerTradeParty>
                </ram:ApplicableHeaderTradeAgreement>
                <ram:ApplicableHeaderTradeDelivery/>
                <ram:ApplicableHeaderTradeSettlement>
                  <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
                  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                    <ram:TaxBasisTotalAmount>100.00</ram:TaxBasisTotalAmount>
                    <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
                    <ram:GrandTotalAmount>120.00</ram:GrandTotalAmount>
                    <ram:DuePayableAmount>120.00</ram:DuePayableAmount>
                  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                </ram:ApplicableHeaderTradeSettlement>
              </rsm:SupplyChainTradeTransaction>
            </rsm:CrossIndustryInvoice>
            ''')

            r = requests.post("http://localhost:3000/forms/pdfengines/factur-x", files=[
                ("files", ("invoice-print.pdf", open("invoice-print.pdf", "rb"))),
                ("facturxXml", ("invoice.xml", open("invoice.xml", "rb"))),
                ("facturxConformanceLevel", (None, "MINIMUM")),
            ])
            r.raise_for_status()
            with open("invoice.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("invoice-print.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await writeFile("invoice.xml", `<?xml version="1.0" encoding="UTF-8"?>
            <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
              <rsm:ExchangedDocumentContext>
                <ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter>
              </rsm:ExchangedDocumentContext>
              <rsm:ExchangedDocument>
                <ram:ID>INV-2026-001</ram:ID>
                <ram:TypeCode>380</ram:TypeCode>
                <ram:IssueDateTime><udt:DateTimeString format="102">20261130</udt:DateTimeString></ram:IssueDateTime>
              </rsm:ExchangedDocument>
              <rsm:SupplyChainTradeTransaction>
                <ram:ApplicableHeaderTradeAgreement>
                  <ram:SellerTradeParty>
                    <ram:Name>Example Ltd</ram:Name>
                    <ram:SpecifiedLegalOrganization><ram:ID>123456789</ram:ID></ram:SpecifiedLegalOrganization>
                    <ram:PostalTradeAddress><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
                    <ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">FR32123456789</ram:ID></ram:SpecifiedTaxRegistration>
                  </ram:SellerTradeParty>
                  <ram:BuyerTradeParty><ram:Name>Client SA</ram:Name></ram:BuyerTradeParty>
                </ram:ApplicableHeaderTradeAgreement>
                <ram:ApplicableHeaderTradeDelivery/>
                <ram:ApplicableHeaderTradeSettlement>
                  <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
                  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                    <ram:TaxBasisTotalAmount>100.00</ram:TaxBasisTotalAmount>
                    <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
                    <ram:GrandTotalAmount>120.00</ram:GrandTotalAmount>
                    <ram:DuePayableAmount>120.00</ram:DuePayableAmount>
                  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                </ram:ApplicableHeaderTradeSettlement>
              </rsm:SupplyChainTradeTransaction>
            </rsm:CrossIndustryInvoice>
            `);

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("invoice-print.pdf")]), "invoice-print.pdf");
              form.append("facturxXml", new Blob([await readFile("invoice.xml")]), "invoice.xml");
              form.append("facturxConformanceLevel", "MINIMUM");
              const res = await fetch("http://localhost:3000/forms/pdfengines/factur-x", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("invoice.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/stamp:
    post:
      operationId: pdfenginesStamp
      summary: Stamp pages
      description: Draws text, a picture or a PDF over the pages. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stamp:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The picture or PDF drawn over the pages.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: What the stamp is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampExpression:
                  type: string
                  description: The stamp's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampPages:
                  type: string
                  description: The pages stamped.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampOptions:
                  type: string
                  contentMediaType: application/json
                  description: "How the stamp is drawn: font, fontSize, color, opacity, rotation, position."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
            encoding:
              stampSource:
                explode: true
              stampExpression:
                explode: true
              stampPages:
                explode: true
              stampOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/stamp -F files=@a.pdf -F stampSource=text -F stampExpression=PAID -o paid.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/stamp -F files=@a.pdf -F stampSource=text -F stampExpression=PAID -o paid.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/stamp", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("stampSource", (None, "text")),
                ("stampExpression", (None, "PAID")),
            ])
            r.raise_for_status()
            with open("paid.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("stampSource", "text");
              form.append("stampExpression", "PAID");
              const res = await fetch("http://localhost:3000/forms/pdfengines/stamp", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("paid.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/watermark:
    post:
      operationId: pdfenginesWatermark
      summary: Watermark pages
      description: Draws text, a picture or a PDF under the pages' content. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermark:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The picture or PDF drawn under the pages' content.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: What the watermark is.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkExpression:
                  type: string
                  description: The watermark's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkPages:
                  type: string
                  description: The pages watermarked.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkOptions:
                  type: string
                  contentMediaType: application/json
                  description: How the watermark is drawn, as for stamps.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
            encoding:
              watermarkSource:
                explode: true
              watermarkExpression:
                explode: true
              watermarkPages:
                explode: true
              watermarkOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/watermark -F files=@a.pdf -F watermarkSource=text -F watermarkExpression=DRAFT -o draft.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/watermark -F files=@a.pdf -F watermarkSource=text -F watermarkExpression=DRAFT -o draft.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/watermark", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("watermarkSource", (None, "text")),
                ("watermarkExpression", (None, "DRAFT")),
            ])
            r.raise_for_status()
            with open("draft.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("watermarkSource", "text");
              form.append("watermarkExpression", "DRAFT");
              const res = await fetch("http://localhost:3000/forms/pdfengines/watermark", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("draft.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/metadata/read:
    post:
      operationId: pdfenginesMetadataRead
      summary: Read PDFs' metadata
      description: Each PDF's metadata, as JSON by file name. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
              required:
                - files
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                additionalProperties:
                  additionalProperties: true
                  type: object
                description: Each PDF's metadata, by file name, under the names ExifTool gives it.
                type: object
              example:
                report.pdf:
                  CreateDate: "2026:11:30 16:44:37Z"
                  Creator: marqius
                  FileType: PDF
                  MIMEType: application/pdf
                  ModifyDate: "2026:11:30 16:44:37Z"
                  PDFVersion: 1.7
                  PageCount: 1
                  Producer: marqius 0.12.18
                  Title: Quarterly report
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "500":
          $ref: "#/components/responses/Status500"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/metadata/read -F files=@a.pdf -o metadata.json
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/metadata/read -F files=@a.pdf -o metadata.json
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/metadata/read", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("metadata.json", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/pdfengines/metadata/read", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("metadata.json", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/metadata/write:
    post:
      operationId: pdfenginesMetadataWrite
      summary: Write PDFs' metadata
      description: Writes metadata into each PDF. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                metadata:
                  type: string
                  contentMediaType: application/json
                  description: "The metadata to write: {\"Author\": \"…\", \"Title\": \"…\"}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - metadata
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/metadata/write -F files=@a.pdf -F 'metadata={"Title":"Hello","Author":"Ada"}' -o titled.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/metadata/write -F files=@a.pdf -F 'metadata={"Title":"Hello","Author":"Ada"}' -o titled.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/metadata/write", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("metadata", (None, "{\"Title\":\"Hello\",\"Author\":\"Ada\"}")),
            ])
            r.raise_for_status()
            with open("titled.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("metadata", "{\"Title\":\"Hello\",\"Author\":\"Ada\"}");
              const res = await fetch("http://localhost:3000/forms/pdfengines/metadata/write", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("titled.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/bookmarks/read:
    post:
      operationId: pdfenginesBookmarksRead
      summary: Read PDFs' bookmarks
      description: Each PDF's bookmarks, as JSON by file name. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
              required:
                - files
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                additionalProperties:
                  items:
                    $ref: "#/components/schemas/Bookmark"
                  type: array
                description: Each PDF's bookmarks, by file name.
                type: object
              example:
                report.pdf:
                  - children:
                      - page: 1
                        title: Detail
                    page: 1
                    title: Start
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "500":
          $ref: "#/components/responses/Status500"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/bookmarks/read -F files=@a.pdf -o bookmarks.json
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/bookmarks/read -F files=@a.pdf -o bookmarks.json
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/bookmarks/read", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("bookmarks.json", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/pdfengines/bookmarks/read", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("bookmarks.json", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdfengines/bookmarks/write:
    post:
      operationId: pdfenginesBookmarksWrite
      summary: Write PDFs' bookmarks
      description: Writes bookmarks into each PDF. Off with `--pdfengines-disable-routes`.
      tags:
        - PDF engines
      x-kern-api: gotenberg-8.40.0
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: The PDFs.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                bookmarks:
                  type: string
                  contentMediaType: application/json
                  description: "The bookmarks: [{\"title\": \"…\", \"page\": 1, \"children\": [...]}], or by file name for several PDFs."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - bookmarks
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdfengines-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdfengines/bookmarks/write -F files=@a.pdf -F 'bookmarks=[{"title":"Start","page":1}]' -o marked.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdfengines/bookmarks/write -F files=@a.pdf -F 'bookmarks=[{"title":"Start","page":1}]' -o marked.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdfengines/bookmarks/write", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("bookmarks", (None, "[{\"title\":\"Start\",\"page\":1}]")),
            ])
            r.raise_for_status()
            with open("marked.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("bookmarks", "[{\"title\":\"Start\",\"page\":1}]");
              const res = await fetch("http://localhost:3000/forms/pdfengines/bookmarks/write", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("marked.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/kern/convert/email:
    post:
      operationId: kernConvertEmail
      summary: Convert emails to PDF
      description: Makes emails and mailboxes into PDFs that keep them whole; what did not reach the pages is said in the X-Marqius-Kern-Note header. Off with `--kern-disable-routes`.
      tags:
        - Marqius Kern
      x-kern-api: kern
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: Emails (.eml, .msg) and mailboxes (.mbox, .pst, .ost).
                  x-kern-api: kern
                  x-kern-effect: honoured
                profile:
                  type: string
                  enum:
                    - archive
                    - court
                    - plain
                  description: |-
                    archive: an EA-PDF with the message and its attachments inside; court: for filing; plain: the message alone.

                    Default: `archive`.
                  default: archive
                  examples:
                    - archive
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernReport:
                  type: boolean
                  description: |-
                    Answers a ZIP of the PDFs and report.json: what each email became and what did not reach its pages.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitMode:
                  type: string
                  enum:
                    - intervals
                    - pages
                  description: "Splits the PDF: `intervals` into parts of splitSpan pages, `pages` into the pages splitSpan names. Several parts are answered as a ZIP."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitSpan:
                  type: string
                  description: "The pages of each part: a number of pages for intervals, page ranges (1-3, 5) for pages."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitUnify:
                  type: boolean
                  description: |-
                    With splitMode pages: the pages chosen in one PDF instead of one PDF each.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                metadata:
                  type: string
                  contentMediaType: application/json
                  description: "The PDF's metadata to write: {\"Author\": \"…\", \"Title\": \"…\", \"Keywords\": [\"…\"]}."
                  examples:
                    - "{\"Title\":\"Marqius Kern\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                flatten:
                  type: boolean
                  description: |-
                    Turns form fields and annotations into the page's own drawing.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts the PDF's restrictions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowPrinting:
                  type: boolean
                  description: |-
                    With a password: printing allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowModifying:
                  type: boolean
                  description: |-
                    With a password: changes allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowCopying:
                  type: boolean
                  description: |-
                    With a password: copying text and pictures allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAnnotating:
                  type: boolean
                  description: |-
                    With a password: comments allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowFillingForms:
                  type: boolean
                  description: |-
                    With a password: filling in forms allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAssembling:
                  type: boolean
                  description: |-
                    With a password: inserting, rotating and deleting pages allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stamp:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn over the pages (stampSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the stamp is: text (stampExpression), or the picture or PDF sent as `stamp`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampExpression:
                  type: string
                  description: The stamp's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampPages:
                  type: string
                  description: "The pages stamped: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampOptions:
                  type: string
                  contentMediaType: application/json
                  description: "How the stamp is drawn: {\"font\": \"Helvetica\", \"fontSize\": 24, \"color\": \"#ff0000\", \"opacity\": 0.5, \"rotation\": 45, \"position\": \"center\"}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermark:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn under the pages' content (watermarkSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the watermark is: text (watermarkExpression), or the picture or PDF sent as `watermark`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkExpression:
                  type: string
                  description: The watermark's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkPages:
                  type: string
                  description: "The pages watermarked: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkOptions:
                  type: string
                  contentMediaType: application/json
                  description: How the watermark is drawn, as for stampOptions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotateAngle:
                  type: string
                  enum:
                    - "90"
                    - "180"
                    - "270"
                  description: Turns the pages by this angle, clockwise.
                  examples:
                    - "90"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotatePages:
                  type: string
                  description: "With rotateAngle: the pages turned: 1-3, 5; all when not given."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeImages:
                  type: boolean
                  description: |-
                    Packs the pictures again as JPEG, for a smaller file.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                imageQuality:
                  type: integer
                  description: "With optimizeImages: the JPEG quality, from 1 to 100."
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernOcr:
                  type: string
                  enum:
                    - "true"
                    - "false"
                    - auto
                  description: |-
                    true (or auto): the pages that need it (scans: little text and a large picture) are read and laid over with hidden text, so the PDF can be searched and copied; the pages look as they did. The summary is in the X-Marqius-Kern-Ocr header.

                    Default: `false`.
                  default: "false"
                  examples:
                    - "false"
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrEngine:
                  type: string
                  description: "The engine that reads: Marqius Kern's own (the server's --kern-ocr-engine unless sent: ppocr-v6-tiny; ppocr-v6-small reads more accurately), tesseract, a folder added with `marqius-kern ocr add`, or an OCR server's name (--kern-ocr-server)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrLanguages:
                  type: string
                  description: "The languages or scripts on the pages, comma-separated (ara, heb, hi, korean...): the default engine is swapped for Marqius Kern's engine that reads them."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrPages:
                  type: string
                  description: "The pages to read if they need it: 1-3,5, even, odd, !1; all unless sent."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrOptional:
                  type: boolean
                  description: |-
                    When OCR cannot run (no engine, a model not fetched yet), the file is answered as it is, with a note, instead of an error.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  description: "Read only to refuse passwords with it, as Gotenberg refuses PDF/A with encryption: the profile decides what kind of PDF each email becomes. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: checked
                kernFontReport:
                  type: boolean
                  description: Says in the X-Marqius-Kern-Fonts header which fonts each conversion used, their files, and what stood in for what (the server's --kern-font-report unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernRequireFonts:
                  type: string
                  description: "Families this request must have, comma-separated: a conversion that cannot have one is refused (409) instead of printed in another font."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
            encoding:
              stampSource:
                explode: true
              stampExpression:
                explode: true
              stampPages:
                explode: true
              stampOptions:
                explode: true
              watermarkSource:
                explode: true
              watermarkExpression:
                explode: true
              watermarkPages:
                explode: true
              watermarkOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--kern-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf 'From: Ada <ada@example.com>\nTo: Bob <bob@example.com>\nSubject: Hello\nDate: Mon, 30 Nov 2026 10:00:00 +0000\nContent-Type: text/plain; charset=utf-8\n\nThe report is attached in spirit.\n' > hello.eml
            curl http://localhost:3000/forms/kern/convert/email -F files=@hello.eml -o hello-email.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf 'From: Ada <ada@example.com>\nTo: Bob <bob@example.com>\nSubject: Hello\nDate: Mon, 30 Nov 2026 10:00:00 +0000\nContent-Type: text/plain; charset=utf-8\n\nThe report is attached in spirit.\n' > hello.eml
            marqius-kern run /forms/kern/convert/email -F files=@hello.eml -o hello-email.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("hello.eml", "w") as f:
                f.write('''From: Ada <ada@example.com>
            To: Bob <bob@example.com>
            Subject: Hello
            Date: Mon, 30 Nov 2026 10:00:00 +0000
            Content-Type: text/plain; charset=utf-8

            The report is attached in spirit.
            ''')

            r = requests.post("http://localhost:3000/forms/kern/convert/email", files=[
                ("files", ("hello.eml", open("hello.eml", "rb"))),
            ])
            r.raise_for_status()
            with open("hello-email.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("hello.eml", `From: Ada <ada@example.com>
            To: Bob <bob@example.com>
            Subject: Hello
            Date: Mon, 30 Nov 2026 10:00:00 +0000
            Content-Type: text/plain; charset=utf-8

            The report is attached in spirit.
            `);

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("hello.eml")]), "hello.eml");
              const res = await fetch("http://localhost:3000/forms/kern/convert/email", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("hello-email.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/kern/ocr:
    post:
      operationId: kernOcr
      summary: Make scans searchable
      description: "Scans (PDFs and pictures) as searchable PDFs: each page read and laid over with hidden text, the pages as they were; several documents are answered as a ZIP. The summary is in the X-Marqius-Kern-Ocr header. Off with `--kern-disable-routes`."
      tags:
        - Marqius Kern
      x-kern-api: kern
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The scans: PDFs and pictures (TIFF, of one page or many; JPEG, PNG, WebP, GIF, BMP), each answered as a PDF; with kernOcrFrom, the results beside them (scan.hocr for scan.pdf)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrEngine:
                  type: string
                  description: "The engine that reads: Marqius Kern's own (the server's --kern-ocr-engine unless sent: ppocr-v6-tiny; ppocr-v6-small reads more accurately), tesseract, a folder added with `marqius-kern ocr add`, or an OCR server's name (--kern-ocr-server)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrLanguages:
                  type: string
                  description: "The languages or scripts on the pages, comma-separated (ara, heb, hi, korean...): the default engine is swapped for Marqius Kern's engine that reads them."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrPages:
                  type: string
                  description: "The pages to read if they need it: 1-3,5, even, odd, !1; all unless sent."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrOptional:
                  type: boolean
                  description: |-
                    When OCR cannot run (no engine, a model not fetched yet), the file is answered as it is, with a note, instead of an error.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernOcrFrom:
                  type: string
                  enum:
                    - hocr
                    - alto
                    - json
                  description: Builds the layer from another engine's results sent with the documents (scan.hocr beside scan.pdf) instead of reading.
                  x-kern-api: kern
                  x-kern-effect: honoured
                pdfa:
                  type: string
                  enum:
                    - PDF/A-1b
                    - PDF/A-2b
                    - PDF/A-2u
                    - PDF/A-3b
                    - PDF/A-3u
                    - PDF/A-4
                  description: The PDF/A level, Marqius Kern's PDF/A-2u and 3u included, where every letter of the text keeps its Unicode meaning.
                  x-kern-api: kern
                  x-kern-effect: honoured
                pdfua:
                  type: boolean
                  description: |-
                    Makes the PDFs accessible (PDF/UA).

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitMode:
                  type: string
                  enum:
                    - intervals
                    - pages
                  description: "Splits the PDF: `intervals` into parts of splitSpan pages, `pages` into the pages splitSpan names. Several parts are answered as a ZIP."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitSpan:
                  type: string
                  description: "The pages of each part: a number of pages for intervals, page ranges (1-3, 5) for pages."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                splitUnify:
                  type: boolean
                  description: |-
                    With splitMode pages: the pages chosen in one PDF instead of one PDF each.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                metadata:
                  type: string
                  contentMediaType: application/json
                  description: "The PDF's metadata to write: {\"Author\": \"…\", \"Title\": \"…\", \"Keywords\": [\"…\"]}."
                  examples:
                    - "{\"Title\":\"Marqius Kern\"}"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                flatten:
                  type: boolean
                  description: |-
                    Turns form fields and annotations into the page's own drawing.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts the PDF's restrictions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowPrinting:
                  type: boolean
                  description: |-
                    With a password: printing allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowModifying:
                  type: boolean
                  description: |-
                    With a password: changes allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowCopying:
                  type: boolean
                  description: |-
                    With a password: copying text and pictures allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAnnotating:
                  type: boolean
                  description: |-
                    With a password: comments allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowFillingForms:
                  type: boolean
                  description: |-
                    With a password: filling in forms allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                allowAssembling:
                  type: boolean
                  description: |-
                    With a password: inserting, rotating and deleting pages allowed.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stamp:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn over the pages (stampSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the stamp is: text (stampExpression), or the picture or PDF sent as `stamp`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampExpression:
                  type: string
                  description: The stamp's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampPages:
                  type: string
                  description: "The pages stamped: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                stampOptions:
                  type: string
                  contentMediaType: application/json
                  description: "How the stamp is drawn: {\"font\": \"Helvetica\", \"fontSize\": 24, \"color\": \"#ff0000\", \"opacity\": 0.5, \"rotation\": 45, \"position\": \"center\"}."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermark:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: A picture or a PDF drawn under the pages' content (watermarkSource image or pdf).
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkSource:
                  type: string
                  enum:
                    - text
                    - image
                    - pdf
                  description: "What the watermark is: text (watermarkExpression), or the picture or PDF sent as `watermark`."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkExpression:
                  type: string
                  description: The watermark's text, or the name of its file.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkPages:
                  type: string
                  description: "The pages watermarked: 1-3, 5; all when not given."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                watermarkOptions:
                  type: string
                  contentMediaType: application/json
                  description: How the watermark is drawn, as for stampOptions.
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotateAngle:
                  type: string
                  enum:
                    - "90"
                    - "180"
                    - "270"
                  description: Turns the pages by this angle, clockwise.
                  examples:
                    - "90"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                rotatePages:
                  type: string
                  description: "With rotateAngle: the pages turned: 1-3, 5; all when not given."
                  examples:
                    - "1"
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                optimizeImages:
                  type: boolean
                  description: |-
                    Packs the pictures again as JPEG, for a smaller file.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                imageQuality:
                  type: integer
                  description: "With optimizeImages: the JPEG quality, from 1 to 100."
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernOcr:
                  type: string
                  enum:
                    - "true"
                    - "false"
                    - auto
                  description: |-
                    true (or auto): the pages that need it (scans: little text and a large picture) are read and laid over with hidden text, so the PDF can be searched and copied; the pages look as they did. The summary is in the X-Marqius-Kern-Ocr header.

                    Default: `false`.
                  default: "false"
                  examples:
                    - "false"
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
            encoding:
              stampSource:
                explode: true
              stampExpression:
                explode: true
              stampPages:
                explode: true
              stampOptions:
                explode: true
              watermarkSource:
                explode: true
              watermarkExpression:
                explode: true
              watermarkPages:
                explode: true
              watermarkOptions:
                explode: true
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "403":
          $ref: "#/components/responses/Status403"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--kern-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/screenshot/html -F files=@index.html -o scan.png
            curl http://localhost:3000/forms/kern/ocr -F files=@scan.png -o searchable.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/screenshot/html -F files=@index.html -o scan.png
            marqius-kern run /forms/kern/ocr -F files=@scan.png -o searchable.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/screenshot/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("scan.png", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/kern/ocr", files=[
                ("files", ("scan.png", open("scan.png", "rb"))),
            ])
            r.raise_for_status()
            with open("searchable.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/screenshot/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("scan.png", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("scan.png")]), "scan.png");
              const res = await fetch("http://localhost:3000/forms/kern/ocr", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("searchable.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/kern/extract/markdown:
    post:
      operationId: kernExtractMarkdown
      summary: Read documents as Markdown
      description: "Any document Marqius Kern converts, and emails, as Markdown (or plain text, or JSON) in reading order, with no PDF made from it: for search, AI agents and no-code tools. What could not be read (a scanned page, a hidden sheet) is said in the X-Marqius-Kern-Note header. Off with `--kern-disable-routes`."
      tags:
        - Marqius Kern
      x-kern-api: kern
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The documents: PDF, Word, Excel, PowerPoint, OpenDocument, RTF, Word 97-2003, text, HTML and Markdown, and emails (.eml, .msg)."
                  x-kern-api: kern
                  x-kern-effect: honoured
                format:
                  type: string
                  enum:
                    - markdown
                    - text
                    - json
                  description: |-
                    markdown; text, plain; or json, one document for them all: each file's name, kind, title and pages, its whole text and each part's (page, slide, sheet, attachment), and what could not be read.

                    Default: `markdown`.
                  default: markdown
                  examples:
                    - markdown
                  x-kern-api: kern
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "A PDF's pages: 1-3,5, even, !last."
                  x-kern-api: kern
                  x-kern-effect: honoured
                pageMarks:
                  type: boolean
                  description: |-
                    In Markdown, `<!-- page 3 -->` before each page of a PDF.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: kern
                  x-kern-effect: honoured
                annotations:
                  type: boolean
                  description: |-
                    The text of form fields, comments and stamps, as a viewer shows it.

                    Default: `true`.
                  default: true
                  examples:
                    - true
                  x-kern-api: kern
                  x-kern-effect: honoured
                artifacts:
                  type: boolean
                  description: |-
                    The running heads and feet and the page numbers.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                invisible:
                  type: boolean
                  description: "Text drawn invisible: true reads every page's, false none. Unless sent, only a searchable scan's text under its picture is read, since invisible text elsewhere can hide words from the people who read the page."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                asText:
                  type: boolean
                  description: |-
                    With format json: the text in it as plain text, not Markdown.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                password:
                  type: string
                  description: Opens a password-protected Office or OpenDocument file.
                  x-kern-api: kern
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: "Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificatePassword:
                  type: string
                  description: "Opens the store or the key; never logged, never echoed. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignReason:
                  type: string
                  description: "The reason the signature gives (the server's --kern-sign-reason unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignLocation:
                  type: string
                  description: "Where the signature says it was made (the server's --kern-sign-location unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignContactInfo:
                  type: string
                  description: "How to reach the signer (the server's --kern-sign-contact-info unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignName:
                  type: string
                  description: "The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignTimestampUrl:
                  type: string
                  description: "An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignField:
                  type: string
                  description: "Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
              required:
                - files
      responses:
        "200":
          description: "The text: Markdown, plain text or JSON, as `format` asks; several documents' texts as a ZIP (one JSON document for them all with `format` json)."
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            text/markdown:
              schema:
                type: string
                contentMediaType: text/markdown
            text/plain:
              schema:
                type: string
                contentMediaType: text/plain
            application/json:
              schema:
                type: object
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "409":
          $ref: "#/components/responses/Status409"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--kern-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  text/markdown:
                    schema:
                      type: string
                      contentMediaType: text/markdown
                  text/plain:
                    schema:
                      type: string
                      contentMediaType: text/plain
                  application/json:
                    schema:
                      type: object
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/kern/extract/markdown -F files=@a.pdf -o a.md
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/kern/extract/markdown -F files=@a.pdf -o a.md
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/kern/extract/markdown", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("a.md", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/kern/extract/markdown", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.md", Buffer.from(await res.arrayBuffer()));
            }
  /forms/kern/openapi.yaml:
    get:
      operationId: kernOpenapiYaml
      summary: Marqius Kern's OpenAPI document
      description: "This document, as YAML: the routes this server answers, and every field each reads. Off with `--kern-disable-routes`."
      tags:
        - Marqius Kern
      x-kern-api: kern
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: Marqius Kern's OpenAPI document.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/yaml:
              schema:
                type: object
        "401":
          $ref: "#/components/responses/Status401"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--kern-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: curl http://localhost:3000/forms/kern/openapi.yaml -o kern-openapi.yaml
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            r = requests.get("http://localhost:3000/forms/kern/openapi.yaml")
            r.raise_for_status()
            with open("kern-openapi.yaml", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            {
              const res = await fetch("http://localhost:3000/forms/kern/openapi.yaml");
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("kern-openapi.yaml", Buffer.from(await res.arrayBuffer()));
            }
    head:
      operationId: kernOpenapiYamlHead
      summary: Marqius Kern's OpenAPI document
      description: "This document, as YAML: the routes this server answers, and every field each reads. Off with `--kern-disable-routes`."
      tags:
        - Marqius Kern
      x-kern-api: kern
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: Marqius Kern's OpenAPI document.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/yaml:
              schema:
                type: object
        "401":
          $ref: "#/components/responses/Status401"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--kern-disable-routes"
  /forms/kern/openapi.json:
    get:
      operationId: kernOpenapiJson
      summary: Marqius Kern's OpenAPI document, as JSON
      description: This document, as JSON. Off with `--kern-disable-routes`.
      tags:
        - Marqius Kern
      x-kern-api: kern
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: Marqius Kern's OpenAPI document.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                type: object
        "401":
          $ref: "#/components/responses/Status401"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--kern-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: curl http://localhost:3000/forms/kern/openapi.json -o kern-openapi.json
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            r = requests.get("http://localhost:3000/forms/kern/openapi.json")
            r.raise_for_status()
            with open("kern-openapi.json", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { writeFile } from "node:fs/promises";

            {
              const res = await fetch("http://localhost:3000/forms/kern/openapi.json");
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("kern-openapi.json", Buffer.from(await res.arrayBuffer()));
            }
    head:
      operationId: kernOpenapiJsonHead
      summary: Marqius Kern's OpenAPI document, as JSON
      description: This document, as JSON. Off with `--kern-disable-routes`.
      tags:
        - Marqius Kern
      x-kern-api: kern
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      responses:
        "200":
          description: Marqius Kern's OpenAPI document.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                type: object
        "401":
          $ref: "#/components/responses/Status401"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--kern-disable-routes"
  /forms/pdf/pipe:
    post:
      operationId: pdfPipe
      summary: Run operations on PDFs
      description: "Runs the operations of `stages` on the PDFs, in order: what one operation leaves, the next takes. A last operation that reads (render, extract-text, extract-attachments) answers its files beside the PDFs, as a ZIP. Off with `--pdf-disable-routes`."
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                stages:
                  type: string
                  contentMediaType: application/json
                  description: "Operations run on the PDFs in order, each with its options as /forms/pdf's routes take them: a JSON array such as [{\"op\":\"set-metadata\",\"title\":\"Report\"},{\"op\":\"encrypt\",\"userPassword\":\"open\"}]."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - stages
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/pipe -F files=@a.pdf -F 'stages=[{"op":"rotate","angle":90},{"op":"set-metadata","title":"Turned"}]' -o turned.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/pipe -F files=@a.pdf -F 'stages=[{"op":"rotate","angle":90},{"op":"set-metadata","title":"Turned"}]' -o turned.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/pipe", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("stages", (None, "[{\"op\":\"rotate\",\"angle\":90},{\"op\":\"set-metadata\",\"title\":\"Turned\"}]")),
            ])
            r.raise_for_status()
            with open("turned.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("stages", "[{\"op\":\"rotate\",\"angle\":90},{\"op\":\"set-metadata\",\"title\":\"Turned\"}]");
              const res = await fetch("http://localhost:3000/forms/pdf/pipe", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("turned.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/merge:
    post:
      operationId: pdfMerge
      summary: Merge PDFs
      description: Merges the PDFs into one, in the order of their names. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                fileBookmarks:
                  type: string
                  contentMediaType: application/json
                  description: "A bookmark for each PDF, labelled from its title or its file name: a JSON object."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            mkdir -p cover && printf '<!doctype html><html><body style="background: #0b3d91"><h1 style="color: white">Cover</h1></body></html>' > cover/index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@cover/index.html -F printBackground=true -o cover.pdf
            curl http://localhost:3000/forms/pdf/merge -F files=@a.pdf -F files=@cover.pdf -o merged.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            mkdir -p cover && printf '<!doctype html><html><body style="background: #0b3d91"><h1 style="color: white">Cover</h1></body></html>' > cover/index.html
            marqius-kern run /forms/chromium/convert/html -F files=@cover/index.html -F printBackground=true -o cover.pdf
            marqius-kern run /forms/pdf/merge -F files=@a.pdf -F files=@cover.pdf -o merged.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import os
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            os.makedirs("cover", exist_ok=True)

            with open("cover/index.html", "w") as f:
                f.write("<!doctype html><html><body style=\"background: #0b3d91\"><h1 style=\"color: white\">Cover</h1></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("cover/index.html", "rb"))),
                ("printBackground", (None, "true")),
            ])
            r.raise_for_status()
            with open("cover.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/merge", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("files", ("cover.pdf", open("cover.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("merged.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { mkdir, readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await mkdir("cover", { recursive: true });

            await writeFile("cover/index.html", "<!doctype html><html><body style=\"background: #0b3d91\"><h1 style=\"color: white\">Cover</h1></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("cover/index.html")]), "index.html");
              form.append("printBackground", "true");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("cover.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("files", new Blob([await readFile("cover.pdf")]), "cover.pdf");
              const res = await fetch("http://localhost:3000/forms/pdf/merge", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("merged.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/split:
    post:
      operationId: pdfSplit
      summary: Split PDFs
      description: Splits each PDF into parts, answered as a ZIP. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                every:
                  type: integer
                  description: Parts of this many pages each.
                  minimum: 1
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                ranges:
                  type: string
                  contentMediaType: application/json
                  description: "Or the parts by their pages: a JSON array such as [\"1-3\",\"4\"]."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            mkdir -p three && printf '<!doctype html><html><body><h1 style="break-after: page">One</h1><h1 style="break-after: page">Two</h1><h1>Three</h1></body></html>' > three/index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@three/index.html -o pages.pdf
            curl http://localhost:3000/forms/pdf/split -F files=@pages.pdf -F every=1 -o parts.zip
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            mkdir -p three && printf '<!doctype html><html><body><h1 style="break-after: page">One</h1><h1 style="break-after: page">Two</h1><h1>Three</h1></body></html>' > three/index.html
            marqius-kern run /forms/chromium/convert/html -F files=@three/index.html -o pages.pdf
            marqius-kern run /forms/pdf/split -F files=@pages.pdf -F every=1 -o parts.zip
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import os
            import requests

            os.makedirs("three", exist_ok=True)

            with open("three/index.html", "w") as f:
                f.write("<!doctype html><html><body><h1 style=\"break-after: page\">One</h1><h1 style=\"break-after: page\">Two</h1><h1>Three</h1></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("three/index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("pages.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/split", files=[
                ("files", ("pages.pdf", open("pages.pdf", "rb"))),
                ("every", (None, "1")),
            ])
            r.raise_for_status()
            with open("parts.zip", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { mkdir, readFile, writeFile } from "node:fs/promises";

            await mkdir("three", { recursive: true });

            await writeFile("three/index.html", "<!doctype html><html><body><h1 style=\"break-after: page\">One</h1><h1 style=\"break-after: page\">Two</h1><h1>Three</h1></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("three/index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("pages.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("pages.pdf")]), "pages.pdf");
              form.append("every", "1");
              const res = await fetch("http://localhost:3000/forms/pdf/split", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("parts.zip", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/select:
    post:
      operationId: pdfSelect
      summary: Keep some pages
      description: Keeps the pages named, in the order named. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "The pages kept, in the order named: 1-3,5, even, odd, last."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            mkdir -p three && printf '<!doctype html><html><body><h1 style="break-after: page">One</h1><h1 style="break-after: page">Two</h1><h1>Three</h1></body></html>' > three/index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@three/index.html -o pages.pdf
            curl http://localhost:3000/forms/pdf/select -F files=@pages.pdf -F pages=3,1 -o picked.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            mkdir -p three && printf '<!doctype html><html><body><h1 style="break-after: page">One</h1><h1 style="break-after: page">Two</h1><h1>Three</h1></body></html>' > three/index.html
            marqius-kern run /forms/chromium/convert/html -F files=@three/index.html -o pages.pdf
            marqius-kern run /forms/pdf/select -F files=@pages.pdf -F pages=3,1 -o picked.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import os
            import requests

            os.makedirs("three", exist_ok=True)

            with open("three/index.html", "w") as f:
                f.write("<!doctype html><html><body><h1 style=\"break-after: page\">One</h1><h1 style=\"break-after: page\">Two</h1><h1>Three</h1></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("three/index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("pages.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/select", files=[
                ("files", ("pages.pdf", open("pages.pdf", "rb"))),
                ("pages", (None, "3,1")),
            ])
            r.raise_for_status()
            with open("picked.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { mkdir, readFile, writeFile } from "node:fs/promises";

            await mkdir("three", { recursive: true });

            await writeFile("three/index.html", "<!doctype html><html><body><h1 style=\"break-after: page\">One</h1><h1 style=\"break-after: page\">Two</h1><h1>Three</h1></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("three/index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("pages.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("pages.pdf")]), "pages.pdf");
              form.append("pages", "3,1");
              const res = await fetch("http://localhost:3000/forms/pdf/select", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("picked.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/delete:
    post:
      operationId: pdfDelete
      summary: Delete pages
      description: Takes the pages named out. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "The pages taken out: 1-3,5, even, odd, last."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            mkdir -p three && printf '<!doctype html><html><body><h1 style="break-after: page">One</h1><h1 style="break-after: page">Two</h1><h1>Three</h1></body></html>' > three/index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@three/index.html -o pages.pdf
            curl http://localhost:3000/forms/pdf/delete -F files=@pages.pdf -F pages=2 -o fewer.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            mkdir -p three && printf '<!doctype html><html><body><h1 style="break-after: page">One</h1><h1 style="break-after: page">Two</h1><h1>Three</h1></body></html>' > three/index.html
            marqius-kern run /forms/chromium/convert/html -F files=@three/index.html -o pages.pdf
            marqius-kern run /forms/pdf/delete -F files=@pages.pdf -F pages=2 -o fewer.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import os
            import requests

            os.makedirs("three", exist_ok=True)

            with open("three/index.html", "w") as f:
                f.write("<!doctype html><html><body><h1 style=\"break-after: page\">One</h1><h1 style=\"break-after: page\">Two</h1><h1>Three</h1></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("three/index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("pages.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/delete", files=[
                ("files", ("pages.pdf", open("pages.pdf", "rb"))),
                ("pages", (None, "2")),
            ])
            r.raise_for_status()
            with open("fewer.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { mkdir, readFile, writeFile } from "node:fs/promises";

            await mkdir("three", { recursive: true });

            await writeFile("three/index.html", "<!doctype html><html><body><h1 style=\"break-after: page\">One</h1><h1 style=\"break-after: page\">Two</h1><h1>Three</h1></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("three/index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("pages.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("pages.pdf")]), "pages.pdf");
              form.append("pages", "2");
              const res = await fetch("http://localhost:3000/forms/pdf/delete", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("fewer.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/insert:
    post:
      operationId: pdfInsert
      summary: Insert pages
      description: Inserts another PDF's pages after a page. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                source:
                  type: string
                  description: The name of the PDF sent with the request whose pages are inserted.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                at:
                  type: integer
                  description: |-
                    The page after which they go: 0 puts them first.

                    Default: `0`.
                  default: 0
                  minimum: 0
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                sourcePages:
                  type: string
                  description: "The source's pages inserted: 1-3,5; all unless given."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - source
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            mkdir -p cover && printf '<!doctype html><html><body style="background: #0b3d91"><h1 style="color: white">Cover</h1></body></html>' > cover/index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@cover/index.html -F printBackground=true -o cover.pdf
            curl http://localhost:3000/forms/pdf/insert -F files=@a.pdf -F files=@cover.pdf -F source=cover.pdf -F at=0 -o with-cover.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            mkdir -p cover && printf '<!doctype html><html><body style="background: #0b3d91"><h1 style="color: white">Cover</h1></body></html>' > cover/index.html
            marqius-kern run /forms/chromium/convert/html -F files=@cover/index.html -F printBackground=true -o cover.pdf
            marqius-kern run /forms/pdf/insert -F files=@a.pdf -F files=@cover.pdf -F source=cover.pdf -F at=0 -o with-cover.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import os
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            os.makedirs("cover", exist_ok=True)

            with open("cover/index.html", "w") as f:
                f.write("<!doctype html><html><body style=\"background: #0b3d91\"><h1 style=\"color: white\">Cover</h1></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("cover/index.html", "rb"))),
                ("printBackground", (None, "true")),
            ])
            r.raise_for_status()
            with open("cover.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/insert", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("files", ("cover.pdf", open("cover.pdf", "rb"))),
                ("source", (None, "cover.pdf")),
                ("at", (None, "0")),
            ])
            r.raise_for_status()
            with open("with-cover.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { mkdir, readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await mkdir("cover", { recursive: true });

            await writeFile("cover/index.html", "<!doctype html><html><body style=\"background: #0b3d91\"><h1 style=\"color: white\">Cover</h1></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("cover/index.html")]), "index.html");
              form.append("printBackground", "true");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("cover.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("files", new Blob([await readFile("cover.pdf")]), "cover.pdf");
              form.append("source", "cover.pdf");
              form.append("at", "0");
              const res = await fetch("http://localhost:3000/forms/pdf/insert", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("with-cover.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/rotate:
    post:
      operationId: pdfRotate
      summary: Rotate pages
      description: Turns pages by a multiple of 90 degrees. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                angle:
                  type: integer
                  description: "The angle, clockwise: a multiple of 90."
                  multipleOf: 90
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "The pages turned: 1-3,5, even, odd, last; all unless given."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - angle
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/rotate -F files=@a.pdf -F angle=90 -o turned.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/rotate -F files=@a.pdf -F angle=90 -o turned.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/rotate", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("angle", (None, "90")),
            ])
            r.raise_for_status()
            with open("turned.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("angle", "90");
              const res = await fetch("http://localhost:3000/forms/pdf/rotate", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("turned.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/compose:
    post:
      operationId: pdfCompose
      summary: Compose pages on new sheets
      description: "Places pages, scaled, on new sheets of a paper size: labels, booklets, several pages to a sheet. Off with `--pdf-disable-routes`."
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                paperSize:
                  type: string
                  description: The new sheets' paper by name, such as A4 or Letter.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                paperWidth:
                  type: string
                  description: "Or the new sheets' width: inches, or a number with a unit (6in, 432pt)."
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                paperHeight:
                  type: string
                  description: And their height.
                  pattern: ^[0-9]*\.?[0-9]+(in|mm|cm|pt|px|pc)?$
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                placements:
                  type: string
                  contentMediaType: application/json
                  description: "Where pages land: a JSON array of objects with source (a PDF's name), sourcePage, page (the sheet), x, y (points from the lower left) and scale."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - placements
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/compose -F files=@a.pdf -F paperSize=A4 -F 'placements=[{"source":"a.pdf","x":0,"y":421,"scale":0.5},{"source":"a.pdf","x":298,"y":421,"scale":0.5}]' -o two-up.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/compose -F files=@a.pdf -F paperSize=A4 -F 'placements=[{"source":"a.pdf","x":0,"y":421,"scale":0.5},{"source":"a.pdf","x":298,"y":421,"scale":0.5}]' -o two-up.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/compose", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("paperSize", (None, "A4")),
                ("placements", (None, "[{\"source\":\"a.pdf\",\"x\":0,\"y\":421,\"scale\":0.5},{\"source\":\"a.pdf\",\"x\":298,\"y\":421,\"scale\":0.5}]")),
            ])
            r.raise_for_status()
            with open("two-up.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("paperSize", "A4");
              form.append("placements", "[{\"source\":\"a.pdf\",\"x\":0,\"y\":421,\"scale\":0.5},{\"source\":\"a.pdf\",\"x\":298,\"y\":421,\"scale\":0.5}]");
              const res = await fetch("http://localhost:3000/forms/pdf/compose", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("two-up.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/encrypt:
    post:
      operationId: pdfEncrypt
      summary: Protect PDFs with a password
      description: Sets the passwords that open a PDF and lift its restrictions, and what a reader may do. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                userPassword:
                  type: string
                  description: The password that opens the PDF.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                ownerPassword:
                  type: string
                  description: The password that lifts its restrictions.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                algorithm:
                  type: string
                  enum:
                    - aes256
                    - aes128
                    - rc4-128
                    - rc4-40
                  description: The encryption.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                permissions:
                  type: string
                  contentMediaType: application/json
                  description: "What a reader may do without the owner password: a JSON object such as {\"print\":false,\"copy\":false}."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/encrypt -F files=@a.pdf -F userPassword=open -o locked.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/encrypt -F files=@a.pdf -F userPassword=open -o locked.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/encrypt", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("userPassword", (None, "open")),
            ])
            r.raise_for_status()
            with open("locked.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("userPassword", "open");
              const res = await fetch("http://localhost:3000/forms/pdf/encrypt", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("locked.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/decrypt:
    post:
      operationId: pdfDecrypt
      summary: Remove PDFs' passwords
      description: Opens password-protected PDFs and answers them without their encryption. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                password:
                  type: string
                  description: The password that opens the PDFs.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/encrypt -F files=@a.pdf -F userPassword=open -o locked.pdf
            curl http://localhost:3000/forms/pdf/decrypt -F files=@locked.pdf -F password=open -o unlocked.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/encrypt -F files=@a.pdf -F userPassword=open -o locked.pdf
            marqius-kern run /forms/pdf/decrypt -F files=@locked.pdf -F password=open -o unlocked.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/encrypt", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("userPassword", (None, "open")),
            ])
            r.raise_for_status()
            with open("locked.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/decrypt", files=[
                ("files", ("locked.pdf", open("locked.pdf", "rb"))),
                ("password", (None, "open")),
            ])
            r.raise_for_status()
            with open("unlocked.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("userPassword", "open");
              const res = await fetch("http://localhost:3000/forms/pdf/encrypt", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("locked.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("locked.pdf")]), "locked.pdf");
              form.append("password", "open");
              const res = await fetch("http://localhost:3000/forms/pdf/decrypt", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("unlocked.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/optimize:
    post:
      operationId: pdfOptimize
      summary: Optimise PDFs
      description: "Makes PDFs smaller without losing anything: object streams, duplicates removed, streams and pictures compressed again without loss, fonts cut to the letters used. Off with `--pdf-disable-routes`."
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                objectStreams:
                  type: boolean
                  description: |-
                    Packs the PDF's objects into compressed object streams.

                    Default: `true`.
                  default: true
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dedup:
                  type: boolean
                  description: |-
                    Keeps one copy of what is the same (pictures, fonts).

                    Default: `true`.
                  default: true
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                recompressImages:
                  type: boolean
                  description: |-
                    Compresses pictures again, without loss.

                    Default: `true`.
                  default: true
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                compressStreams:
                  type: boolean
                  description: |-
                    Compresses the content streams again.

                    Default: `true`.
                  default: true
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                subsetFonts:
                  type: boolean
                  description: |-
                    Cuts the fonts down to the letters used.

                    Default: `true`.
                  default: true
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/optimize -F files=@a.pdf -o small.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/optimize -F files=@a.pdf -o small.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/optimize", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("small.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/pdf/optimize", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("small.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/set-metadata:
    post:
      operationId: pdfSetMetadata
      summary: Write PDFs' metadata
      description: Writes the document's title, author and other details. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                title:
                  type: string
                  description: The document's title.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                author:
                  type: string
                  description: Its author.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                subject:
                  type: string
                  description: Its subject.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                keywords:
                  type: string
                  description: Its keywords.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                creator:
                  type: string
                  description: The program that made the original document.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                producer:
                  type: string
                  description: The program that made the PDF.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                creationDate:
                  type: string
                  description: When it was made, as an RFC 3339 date and time.
                  format: date-time
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                modDate:
                  type: string
                  description: When it was last changed, as an RFC 3339 date and time.
                  format: date-time
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/set-metadata -F files=@a.pdf -F title=Hello -F author=Ada -o titled.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/set-metadata -F files=@a.pdf -F title=Hello -F author=Ada -o titled.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/set-metadata", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("title", (None, "Hello")),
                ("author", (None, "Ada")),
            ])
            r.raise_for_status()
            with open("titled.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("title", "Hello");
              form.append("author", "Ada");
              const res = await fetch("http://localhost:3000/forms/pdf/set-metadata", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("titled.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/set-bookmarks:
    post:
      operationId: pdfSetBookmarks
      summary: Write PDFs' bookmarks
      description: Replaces each PDF's bookmarks. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                bookmarks:
                  type: string
                  contentMediaType: application/json
                  description: "The bookmarks: a JSON array of objects with title, pageNumber and children, such as [{\"title\":\"Intro\",\"pageNumber\":1}]."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - bookmarks
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/set-bookmarks -F files=@a.pdf -F 'bookmarks=[{"title":"Start","pageNumber":1}]' -o marked.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/set-bookmarks -F files=@a.pdf -F 'bookmarks=[{"title":"Start","pageNumber":1}]' -o marked.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/set-bookmarks", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("bookmarks", (None, "[{\"title\":\"Start\",\"pageNumber\":1}]")),
            ])
            r.raise_for_status()
            with open("marked.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("bookmarks", "[{\"title\":\"Start\",\"pageNumber\":1}]");
              const res = await fetch("http://localhost:3000/forms/pdf/set-bookmarks", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("marked.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/attach:
    post:
      operationId: pdfAttach
      summary: Carry a file inside PDFs
      description: Carries a file sent with the request inside each PDF, as an attachment. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                file:
                  type: string
                  description: The name of the file sent with the request that each PDF carries.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                name:
                  type: string
                  description: The name it takes in the PDF; its own unless given.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                mimeType:
                  type: string
                  description: Its media type, such as text/xml.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                relationship:
                  type: string
                  enum:
                    - Source
                    - Data
                    - Alternative
                    - Supplement
                    - Unspecified
                  description: How it relates to the PDF (PDF/A-3's AFRelationship).
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - file
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            curl http://localhost:3000/forms/pdf/attach -F files=@a.pdf -F files=@note.txt -F file=note.txt -o with-note.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            marqius-kern run /forms/pdf/attach -F files=@a.pdf -F files=@note.txt -F file=note.txt -o with-note.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            with open("note.txt", "w") as f:
                f.write("Shipped on Friday.\n")

            r = requests.post("http://localhost:3000/forms/pdf/attach", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("files", ("note.txt", open("note.txt", "rb"))),
                ("file", (None, "note.txt")),
            ])
            r.raise_for_status()
            with open("with-note.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await writeFile("note.txt", "Shipped on Friday.\n");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("files", new Blob([await readFile("note.txt")]), "note.txt");
              form.append("file", "note.txt");
              const res = await fetch("http://localhost:3000/forms/pdf/attach", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("with-note.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/detach:
    post:
      operationId: pdfDetach
      summary: Remove files carried in PDFs
      description: Takes attachments out of each PDF. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                name:
                  type: string
                  description: The attachment taken out, by name; every one unless given.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            curl http://localhost:3000/forms/pdf/attach -F files=@a.pdf -F files=@note.txt -F file=note.txt -o with-note.pdf
            curl http://localhost:3000/forms/pdf/detach -F files=@with-note.pdf -F name=note.txt -o without-note.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            marqius-kern run /forms/pdf/attach -F files=@a.pdf -F files=@note.txt -F file=note.txt -o with-note.pdf
            marqius-kern run /forms/pdf/detach -F files=@with-note.pdf -F name=note.txt -o without-note.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            with open("note.txt", "w") as f:
                f.write("Shipped on Friday.\n")

            r = requests.post("http://localhost:3000/forms/pdf/attach", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("files", ("note.txt", open("note.txt", "rb"))),
                ("file", (None, "note.txt")),
            ])
            r.raise_for_status()
            with open("with-note.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/detach", files=[
                ("files", ("with-note.pdf", open("with-note.pdf", "rb"))),
                ("name", (None, "note.txt")),
            ])
            r.raise_for_status()
            with open("without-note.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await writeFile("note.txt", "Shipped on Friday.\n");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("files", new Blob([await readFile("note.txt")]), "note.txt");
              form.append("file", "note.txt");
              const res = await fetch("http://localhost:3000/forms/pdf/attach", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("with-note.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("with-note.pdf")]), "with-note.pdf");
              form.append("name", "note.txt");
              const res = await fetch("http://localhost:3000/forms/pdf/detach", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("without-note.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/extract-attachments:
    post:
      operationId: pdfExtractAttachments
      summary: Take out files carried in PDFs
      description: Answers the files the PDFs carry, as they are. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                name:
                  type: string
                  description: The attachment answered, by name; every one unless given.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: "Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificatePassword:
                  type: string
                  description: "Opens the store or the key; never logged, never echoed. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignReason:
                  type: string
                  description: "The reason the signature gives (the server's --kern-sign-reason unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignLocation:
                  type: string
                  description: "Where the signature says it was made (the server's --kern-sign-location unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignContactInfo:
                  type: string
                  description: "How to reach the signer (the server's --kern-sign-contact-info unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignName:
                  type: string
                  description: "The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignTimestampUrl:
                  type: string
                  description: "An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignField:
                  type: string
                  description: "Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
              required:
                - files
      responses:
        "200":
          description: "The files: one as it is, several as a ZIP."
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/octet-stream:
              schema:
                type: string
                contentMediaType: application/octet-stream
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/octet-stream:
                    schema:
                      type: string
                      contentMediaType: application/octet-stream
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            curl http://localhost:3000/forms/pdf/attach -F files=@a.pdf -F files=@note.txt -F file=note.txt -o with-note.pdf
            curl http://localhost:3000/forms/pdf/extract-attachments -F files=@with-note.pdf -o note-back.txt
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            marqius-kern run /forms/pdf/attach -F files=@a.pdf -F files=@note.txt -F file=note.txt -o with-note.pdf
            marqius-kern run /forms/pdf/extract-attachments -F files=@with-note.pdf -o note-back.txt
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            with open("note.txt", "w") as f:
                f.write("Shipped on Friday.\n")

            r = requests.post("http://localhost:3000/forms/pdf/attach", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("files", ("note.txt", open("note.txt", "rb"))),
                ("file", (None, "note.txt")),
            ])
            r.raise_for_status()
            with open("with-note.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/extract-attachments", files=[
                ("files", ("with-note.pdf", open("with-note.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("note-back.txt", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await writeFile("note.txt", "Shipped on Friday.\n");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("files", new Blob([await readFile("note.txt")]), "note.txt");
              form.append("file", "note.txt");
              const res = await fetch("http://localhost:3000/forms/pdf/attach", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("with-note.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("with-note.pdf")]), "with-note.pdf");
              const res = await fetch("http://localhost:3000/forms/pdf/extract-attachments", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("note-back.txt", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/extract-text:
    post:
      operationId: pdfExtractText
      summary: Read PDFs' text
      description: Answers each PDF's text, as plain text or Markdown, in reading order. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "The pages read: 1-3,5, even, odd, last; all unless given."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                format:
                  type: string
                  enum:
                    - text
                    - markdown
                  description: |-
                    Plain text, or Markdown with headings, lists and tables.

                    Default: `text`.
                  default: text
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                invisible:
                  type: boolean
                  description: |-
                    Reads text drawn invisible too, such as a searchable scan's layer.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                artifacts:
                  type: boolean
                  description: |-
                    Reads the running heads and feet and the page numbers too.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                annotations:
                  type: boolean
                  description: |-
                    Reads the text of form fields, comments and stamps too.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: "Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificatePassword:
                  type: string
                  description: "Opens the store or the key; never logged, never echoed. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignReason:
                  type: string
                  description: "The reason the signature gives (the server's --kern-sign-reason unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignLocation:
                  type: string
                  description: "Where the signature says it was made (the server's --kern-sign-location unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignContactInfo:
                  type: string
                  description: "How to reach the signer (the server's --kern-sign-contact-info unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignName:
                  type: string
                  description: "The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignTimestampUrl:
                  type: string
                  description: "An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignField:
                  type: string
                  description: "Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
              required:
                - files
      responses:
        "200":
          description: "The text: Markdown, plain text or JSON, as `format` asks; several documents' texts as a ZIP (one JSON document for them all with `format` json)."
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            text/markdown:
              schema:
                type: string
                contentMediaType: text/markdown
            text/plain:
              schema:
                type: string
                contentMediaType: text/plain
            application/json:
              schema:
                type: object
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  text/markdown:
                    schema:
                      type: string
                      contentMediaType: text/markdown
                  text/plain:
                    schema:
                      type: string
                      contentMediaType: text/plain
                  application/json:
                    schema:
                      type: object
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/extract-text -F files=@a.pdf -F format=markdown -o a.md
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/extract-text -F files=@a.pdf -F format=markdown -o a.md
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/extract-text", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("format", (None, "markdown")),
            ])
            r.raise_for_status()
            with open("a.md", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("format", "markdown");
              const res = await fetch("http://localhost:3000/forms/pdf/extract-text", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.md", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/render:
    post:
      operationId: pdfRender
      summary: Draw pages as pictures
      description: Draws the pages as PNG or JPEG pictures, named by page. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "The pages drawn: 1-3,5, even, odd, last; all unless given."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dpi:
                  type: integer
                  description: |-
                    The pictures' resolution, in dots per inch.

                    Default: `150`.
                  default: 150
                  minimum: 1
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                format:
                  type: string
                  enum:
                    - png
                    - jpeg
                  description: |-
                    The pictures' format.

                    Default: `png`.
                  default: png
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                quality:
                  type: integer
                  description: "With jpeg: the quality, from 1 to 100."
                  minimum: 1
                  maximum: 100
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: "Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignCertificatePassword:
                  type: string
                  description: "Opens the store or the key; never logged, never echoed. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignReason:
                  type: string
                  description: "The reason the signature gives (the server's --kern-sign-reason unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignLocation:
                  type: string
                  description: "Where the signature says it was made (the server's --kern-sign-location unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignContactInfo:
                  type: string
                  description: "How to reach the signer (the server's --kern-sign-contact-info unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignName:
                  type: string
                  description: "The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignTimestampUrl:
                  type: string
                  description: "An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignField:
                  type: string
                  description: "Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  x-kern-api: kern
                  x-kern-effect: noted
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. It does nothing on this route: Marqius Kern says so in the X-Marqius-Kern-Note header."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: noted
              required:
                - files
      responses:
        "200":
          description: "The picture: PNG, JPEG or WebP, as `format` asks; several as a ZIP."
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            image/png:
              schema:
                type: string
                contentMediaType: image/png
            image/jpeg:
              schema:
                type: string
                contentMediaType: image/jpeg
            image/webp:
              schema:
                type: string
                contentMediaType: image/webp
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  image/png:
                    schema:
                      type: string
                      contentMediaType: image/png
                  image/jpeg:
                    schema:
                      type: string
                      contentMediaType: image/jpeg
                  image/webp:
                    schema:
                      type: string
                      contentMediaType: image/webp
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/render -F files=@a.pdf -F dpi=72 -o page.png
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/render -F files=@a.pdf -F dpi=72 -o page.png
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/render", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("dpi", (None, "72")),
            ])
            r.raise_for_status()
            with open("page.png", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("dpi", "72");
              const res = await fetch("http://localhost:3000/forms/pdf/render", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("page.png", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/stamp-text:
    post:
      operationId: pdfStampText
      summary: Stamp text on pages
      description: Draws a line of text over the pages. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                text:
                  type: string
                  description: The text drawn.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "The pages stamped: 1-3,5, even, odd, last; all unless given."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                x:
                  type: number
                  description: |-
                    The stamp's place across, in points from the left (or from the position given).

                    Default: `0`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                "y":
                  type: number
                  description: |-
                    Its place up, in points from the bottom (or from the position given).

                    Default: `0`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                position:
                  type: string
                  enum:
                    - center
                    - top-left
                    - top
                    - top-right
                    - left
                    - right
                    - bottom-left
                    - bottom
                    - bottom-right
                  description: Where on the page x and y count from.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                rotation:
                  type: number
                  description: |-
                    Its angle, in degrees.

                    Default: `0`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                fontSize:
                  type: number
                  description: |-
                    The text's size, in points.

                    Default: `12`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                font:
                  type: string
                  description: |-
                    One of the 14 standard PDF fonts, such as Helvetica or Times-Roman.

                    Default: `Helvetica`.
                  default: Helvetica
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                color:
                  type: string
                  description: "The text's colour, as #rrggbb."
                  pattern: ^#[0-9A-Fa-f]{6}$
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                opacity:
                  type: number
                  description: From 0 (clear) to 1.
                  minimum: 0.0
                  maximum: 1.0
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - text
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/stamp-text -F files=@a.pdf -F text=PAID -F position=top-right -F fontSize=36 -F color=#cc0000 -o paid.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/stamp-text -F files=@a.pdf -F text=PAID -F position=top-right -F fontSize=36 -F color=#cc0000 -o paid.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/stamp-text", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("text", (None, "PAID")),
                ("position", (None, "top-right")),
                ("fontSize", (None, "36")),
                ("color", (None, "#cc0000")),
            ])
            r.raise_for_status()
            with open("paid.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("text", "PAID");
              form.append("position", "top-right");
              form.append("fontSize", "36");
              form.append("color", "#cc0000");
              const res = await fetch("http://localhost:3000/forms/pdf/stamp-text", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("paid.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/stamp-image:
    post:
      operationId: pdfStampImage
      summary: Stamp a picture on pages
      description: Draws a picture sent with the request over the pages. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                image:
                  type: string
                  description: The name of the picture sent with the request.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "The pages stamped: 1-3,5, even, odd, last; all unless given."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                x:
                  type: number
                  description: |-
                    The stamp's place across, in points from the left (or from the position given).

                    Default: `0`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                "y":
                  type: number
                  description: |-
                    Its place up, in points from the bottom (or from the position given).

                    Default: `0`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                position:
                  type: string
                  enum:
                    - center
                    - top-left
                    - top
                    - top-right
                    - left
                    - right
                    - bottom-left
                    - bottom
                    - bottom-right
                  description: Where on the page x and y count from.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                rotation:
                  type: number
                  description: |-
                    Its angle, in degrees.

                    Default: `0`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                width:
                  type: number
                  description: The picture's width, in points.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                height:
                  type: number
                  description: Its height, in points.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                opacity:
                  type: number
                  description: From 0 (clear) to 1.
                  minimum: 0.0
                  maximum: 1.0
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - image
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/chromium/screenshot/html -F files=@index.html -F width=400 -F height=120 -o logo.png
            curl http://localhost:3000/forms/pdf/stamp-image -F files=@a.pdf -F files=@logo.png -F image=logo.png -F position=bottom-right -F width=200 -F height=60 -o stamped.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/chromium/screenshot/html -F files=@index.html -F width=400 -F height=120 -o logo.png
            marqius-kern run /forms/pdf/stamp-image -F files=@a.pdf -F files=@logo.png -F image=logo.png -F position=bottom-right -F width=200 -F height=60 -o stamped.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/chromium/screenshot/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
                ("width", (None, "400")),
                ("height", (None, "120")),
            ])
            r.raise_for_status()
            with open("logo.png", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/stamp-image", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("files", ("logo.png", open("logo.png", "rb"))),
                ("image", (None, "logo.png")),
                ("position", (None, "bottom-right")),
                ("width", (None, "200")),
                ("height", (None, "60")),
            ])
            r.raise_for_status()
            with open("stamped.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              form.append("width", "400");
              form.append("height", "120");
              const res = await fetch("http://localhost:3000/forms/chromium/screenshot/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("logo.png", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("files", new Blob([await readFile("logo.png")]), "logo.png");
              form.append("image", "logo.png");
              form.append("position", "bottom-right");
              form.append("width", "200");
              form.append("height", "60");
              const res = await fetch("http://localhost:3000/forms/pdf/stamp-image", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("stamped.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/stamp-pdf:
    post:
      operationId: pdfStampPdf
      summary: Stamp a PDF's page on pages
      description: Draws a page of a PDF sent with the request over the pages. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                source:
                  type: string
                  description: The name of the PDF sent with the request whose page is drawn.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                sourcePage:
                  type: integer
                  description: |-
                    The page of it drawn.

                    Default: `1`.
                  default: 1
                  minimum: 1
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "The pages stamped: 1-3,5, even, odd, last; all unless given."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                x:
                  type: number
                  description: |-
                    The stamp's place across, in points from the left (or from the position given).

                    Default: `0`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                "y":
                  type: number
                  description: |-
                    Its place up, in points from the bottom (or from the position given).

                    Default: `0`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                position:
                  type: string
                  enum:
                    - center
                    - top-left
                    - top
                    - top-right
                    - left
                    - right
                    - bottom-left
                    - bottom
                    - bottom-right
                  description: Where on the page x and y count from.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                rotation:
                  type: number
                  description: |-
                    Its angle, in degrees.

                    Default: `0`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                scale:
                  type: number
                  description: |-
                    How many times as big it is drawn.

                    Default: `1`.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                opacity:
                  type: number
                  description: From 0 (clear) to 1.
                  minimum: 0.0
                  maximum: 1.0
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - source
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            mkdir -p cover && printf '<!doctype html><html><body style="background: #0b3d91"><h1 style="color: white">Cover</h1></body></html>' > cover/index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@cover/index.html -F printBackground=true -o cover.pdf
            curl http://localhost:3000/forms/pdf/stamp-pdf -F files=@a.pdf -F files=@cover.pdf -F source=cover.pdf -F scale=0.25 -F position=bottom-right -o stamped.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            mkdir -p cover && printf '<!doctype html><html><body style="background: #0b3d91"><h1 style="color: white">Cover</h1></body></html>' > cover/index.html
            marqius-kern run /forms/chromium/convert/html -F files=@cover/index.html -F printBackground=true -o cover.pdf
            marqius-kern run /forms/pdf/stamp-pdf -F files=@a.pdf -F files=@cover.pdf -F source=cover.pdf -F scale=0.25 -F position=bottom-right -o stamped.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import os
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            os.makedirs("cover", exist_ok=True)

            with open("cover/index.html", "w") as f:
                f.write("<!doctype html><html><body style=\"background: #0b3d91\"><h1 style=\"color: white\">Cover</h1></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("cover/index.html", "rb"))),
                ("printBackground", (None, "true")),
            ])
            r.raise_for_status()
            with open("cover.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/stamp-pdf", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("files", ("cover.pdf", open("cover.pdf", "rb"))),
                ("source", (None, "cover.pdf")),
                ("scale", (None, "0.25")),
                ("position", (None, "bottom-right")),
            ])
            r.raise_for_status()
            with open("stamped.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { mkdir, readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await mkdir("cover", { recursive: true });

            await writeFile("cover/index.html", "<!doctype html><html><body style=\"background: #0b3d91\"><h1 style=\"color: white\">Cover</h1></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("cover/index.html")]), "index.html");
              form.append("printBackground", "true");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("cover.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("files", new Blob([await readFile("cover.pdf")]), "cover.pdf");
              form.append("source", "cover.pdf");
              form.append("scale", "0.25");
              form.append("position", "bottom-right");
              const res = await fetch("http://localhost:3000/forms/pdf/stamp-pdf", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("stamped.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/redact:
    post:
      operationId: pdfRedact
      summary: Redact PDFs
      description: Takes the content under the regions named out of the pages, text and pictures alike, and covers the regions. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                regions:
                  type: string
                  contentMediaType: application/json
                  description: "The regions taken out: a JSON array of objects with page, x, y, width and height (points from the lower left)."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - regions
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/redact -F files=@a.pdf -F 'regions=[{"page":1,"x":0,"y":700,"width":595,"height":142}]' -o redacted.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/redact -F files=@a.pdf -F 'regions=[{"page":1,"x":0,"y":700,"width":595,"height":142}]' -o redacted.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/redact", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("regions", (None, "[{\"page\":1,\"x\":0,\"y\":700,\"width\":595,\"height\":142}]")),
            ])
            r.raise_for_status()
            with open("redacted.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("regions", "[{\"page\":1,\"x\":0,\"y\":700,\"width\":595,\"height\":142}]");
              const res = await fetch("http://localhost:3000/forms/pdf/redact", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("redacted.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/set-form:
    post:
      operationId: pdfSetForm
      summary: Fill in PDF forms
      description: Fills in each PDF's form fields, drawing them as a viewer would, signatures kept. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                fields:
                  type: string
                  contentMediaType: application/json
                  description: "The values, by field name: a JSON object; a check box takes its state's name, such as Yes or Off; a list that selects several takes an array."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - fields
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: "cat > form.pdf <<'PDF'\n%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\nPDF\ncurl http://localhost:3000/forms/pdf/set-form -F files=@form.pdf -F 'fields={\"name\":\"Ada Lovelace\"}' -o filled.pdf"
        - lang: Shell
          label: marqius-kern run, no server
          source: "cat > form.pdf <<'PDF'\n%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\nPDF\nmarqius-kern run /forms/pdf/set-form -F files=@form.pdf -F 'fields={\"name\":\"Ada Lovelace\"}' -o filled.pdf"
        - lang: Python
          label: Python
          source: "# Python 3 with requests (pip install requests)\nimport requests\n\nwith open(\"form.pdf\", \"w\") as f:\n    f.write('''%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\n''')\n\nr = requests.post(\"http://localhost:3000/forms/pdf/set-form\", files=[\n    (\"files\", (\"form.pdf\", open(\"form.pdf\", \"rb\"))),\n    (\"fields\", (None, \"{\\\"name\\\":\\\"Ada Lovelace\\\"}\")),\n])\nr.raise_for_status()\nwith open(\"filled.pdf\", \"wb\") as f:\n    f.write(r.content)"
        - lang: JavaScript
          label: JavaScript
          source: "// Node 18 or later: save as sample.mjs, then run node sample.mjs\nimport { readFile, writeFile } from \"node:fs/promises\";\n\nawait writeFile(\"form.pdf\", `%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\n`);\n\n{\n  const form = new FormData();\n  form.append(\"files\", new Blob([await readFile(\"form.pdf\")]), \"form.pdf\");\n  form.append(\"fields\", \"{\\\"name\\\":\\\"Ada Lovelace\\\"}\");\n  const res = await fetch(\"http://localhost:3000/forms/pdf/set-form\", { method: \"POST\", body: form });\n  if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);\n  await writeFile(\"filled.pdf\", Buffer.from(await res.arrayBuffer()));\n}"
  /forms/pdf/flatten-form:
    post:
      operationId: pdfFlattenForm
      summary: Flatten PDF forms
      description: Turns the form fields into the pages' own drawing. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: "cat > form.pdf <<'PDF'\n%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\nPDF\ncurl http://localhost:3000/forms/pdf/set-form -F files=@form.pdf -F 'fields={\"name\":\"Ada Lovelace\"}' -o filled.pdf\ncurl http://localhost:3000/forms/pdf/flatten-form -F files=@filled.pdf -o flat.pdf"
        - lang: Shell
          label: marqius-kern run, no server
          source: "cat > form.pdf <<'PDF'\n%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\nPDF\nmarqius-kern run /forms/pdf/set-form -F files=@form.pdf -F 'fields={\"name\":\"Ada Lovelace\"}' -o filled.pdf\nmarqius-kern run /forms/pdf/flatten-form -F files=@filled.pdf -o flat.pdf"
        - lang: Python
          label: Python
          source: "# Python 3 with requests (pip install requests)\nimport requests\n\nwith open(\"form.pdf\", \"w\") as f:\n    f.write('''%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\n''')\n\nr = requests.post(\"http://localhost:3000/forms/pdf/set-form\", files=[\n    (\"files\", (\"form.pdf\", open(\"form.pdf\", \"rb\"))),\n    (\"fields\", (None, \"{\\\"name\\\":\\\"Ada Lovelace\\\"}\")),\n])\nr.raise_for_status()\nwith open(\"filled.pdf\", \"wb\") as f:\n    f.write(r.content)\n\nr = requests.post(\"http://localhost:3000/forms/pdf/flatten-form\", files=[\n    (\"files\", (\"filled.pdf\", open(\"filled.pdf\", \"rb\"))),\n])\nr.raise_for_status()\nwith open(\"flat.pdf\", \"wb\") as f:\n    f.write(r.content)"
        - lang: JavaScript
          label: JavaScript
          source: "// Node 18 or later: save as sample.mjs, then run node sample.mjs\nimport { readFile, writeFile } from \"node:fs/promises\";\n\nawait writeFile(\"form.pdf\", `%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\n`);\n\n{\n  const form = new FormData();\n  form.append(\"files\", new Blob([await readFile(\"form.pdf\")]), \"form.pdf\");\n  form.append(\"fields\", \"{\\\"name\\\":\\\"Ada Lovelace\\\"}\");\n  const res = await fetch(\"http://localhost:3000/forms/pdf/set-form\", { method: \"POST\", body: form });\n  if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);\n  await writeFile(\"filled.pdf\", Buffer.from(await res.arrayBuffer()));\n}\n\n{\n  const form = new FormData();\n  form.append(\"files\", new Blob([await readFile(\"filled.pdf\")]), \"filled.pdf\");\n  const res = await fetch(\"http://localhost:3000/forms/pdf/flatten-form\", { method: \"POST\", body: form });\n  if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);\n  await writeFile(\"flat.pdf\", Buffer.from(await res.arrayBuffer()));\n}"
  /forms/pdf/flatten-transparency:
    post:
      operationId: pdfFlattenTransparency
      summary: Flatten see-through drawing
      description: Draws what is see-through as it looks, so that printers and PDF/A-1 take it; text stays text. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><div style="width: 300px; height: 120px; background: rgba(0, 90, 200, 0.4)">See-through</div></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -F printBackground=true -o a.pdf
            curl http://localhost:3000/forms/pdf/flatten-transparency -F files=@a.pdf -o flat.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><div style="width: 300px; height: 120px; background: rgba(0, 90, 200, 0.4)">See-through</div></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -F printBackground=true -o a.pdf
            marqius-kern run /forms/pdf/flatten-transparency -F files=@a.pdf -o flat.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><div style=\"width: 300px; height: 120px; background: rgba(0, 90, 200, 0.4)\">See-through</div></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
                ("printBackground", (None, "true")),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/flatten-transparency", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("flat.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><div style=\"width: 300px; height: 120px; background: rgba(0, 90, 200, 0.4)\">See-through</div></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              form.append("printBackground", "true");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/pdf/flatten-transparency", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("flat.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/convert-colors:
    post:
      operationId: pdfConvertColors
      summary: Convert PDFs' colours
      description: "Draws the pages in one kind of colour: CMYK, RGB, grey, or the PDF's output intent. Off with `--pdf-disable-routes`."
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                target:
                  type: string
                  enum:
                    - cmyk
                    - rgb
                    - gray
                    - output-intent
                  description: The colours the pages are drawn in.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
                - target
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/convert-colors -F files=@a.pdf -F target=gray -o gray.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/convert-colors -F files=@a.pdf -F target=gray -o gray.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/convert-colors", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("target", (None, "gray")),
            ])
            r.raise_for_status()
            with open("gray.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("target", "gray");
              const res = await fetch("http://localhost:3000/forms/pdf/convert-colors", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("gray.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/remediate:
    post:
      operationId: pdfRemediate
      summary: Make PDFs PDF/A, PDF/UA or Factur-X
      description: Makes each PDF a PDF/A level, accessible (PDF/UA, with a real structure), both, or a Factur-X invoice carrying the XML sent; what could not be met is said in the Gotenberg-Remediation-Residual header. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                profile:
                  type: string
                  description: "What the PDF is made: a PDF/A level (PDF/A-1b to PDF/A-4f), PDF/UA-1 or 2, both as a JSON pair such as [\"PDF/A-2b\",\"PDF/UA-1\"], or Factur-X."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                language:
                  type: string
                  description: The document's language, such as en-US; told from its words when not given.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                aggressive:
                  type: boolean
                  description: |-
                    Mends what a careful pass leaves, at the risk of changing how a page looks.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                figureAltText:
                  type: string
                  description: The alternative text given to figures that have none.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                xml:
                  type: string
                  description: "With Factur-X: the name of the invoice's XML sent with the request."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                level:
                  type: string
                  enum:
                    - MINIMUM
                    - BASIC WL
                    - BASIC
                    - EN 16931
                    - EXTENDED
                    - XRECHNUNG
                  description: "With Factur-X: the XML's profile, as the XML's guideline names it."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                documentType:
                  type: string
                  description: "With Factur-X: what the XML is, such as INVOICE."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                dropSignatures:
                  type: boolean
                  description: |-
                    true: a signed PDF has its signatures taken out, as the change would break them; otherwise a signed PDF is refused.

                    Default: `false`.
                  default: false
                  examples:
                    - false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/remediate -F files=@a.pdf -F profile=PDF/A-2b -o archive.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/remediate -F files=@a.pdf -F profile=PDF/A-2b -o archive.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/remediate", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("profile", (None, "PDF/A-2b")),
            ])
            r.raise_for_status()
            with open("archive.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("profile", "PDF/A-2b");
              const res = await fetch("http://localhost:3000/forms/pdf/remediate", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("archive.pdf", Buffer.from(await res.arrayBuffer()));
            }
        - lang: Shell
          label: curl (a Factur-X invoice)
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o invoice-print.pdf
            cat > invoice.xml <<'XML'
            <?xml version="1.0" encoding="UTF-8"?>
            <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
              <rsm:ExchangedDocumentContext>
                <ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter>
              </rsm:ExchangedDocumentContext>
              <rsm:ExchangedDocument>
                <ram:ID>INV-2026-001</ram:ID>
                <ram:TypeCode>380</ram:TypeCode>
                <ram:IssueDateTime><udt:DateTimeString format="102">20261130</udt:DateTimeString></ram:IssueDateTime>
              </rsm:ExchangedDocument>
              <rsm:SupplyChainTradeTransaction>
                <ram:ApplicableHeaderTradeAgreement>
                  <ram:SellerTradeParty>
                    <ram:Name>Example Ltd</ram:Name>
                    <ram:SpecifiedLegalOrganization><ram:ID>123456789</ram:ID></ram:SpecifiedLegalOrganization>
                    <ram:PostalTradeAddress><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
                    <ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">FR32123456789</ram:ID></ram:SpecifiedTaxRegistration>
                  </ram:SellerTradeParty>
                  <ram:BuyerTradeParty><ram:Name>Client SA</ram:Name></ram:BuyerTradeParty>
                </ram:ApplicableHeaderTradeAgreement>
                <ram:ApplicableHeaderTradeDelivery/>
                <ram:ApplicableHeaderTradeSettlement>
                  <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
                  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                    <ram:TaxBasisTotalAmount>100.00</ram:TaxBasisTotalAmount>
                    <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
                    <ram:GrandTotalAmount>120.00</ram:GrandTotalAmount>
                    <ram:DuePayableAmount>120.00</ram:DuePayableAmount>
                  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                </ram:ApplicableHeaderTradeSettlement>
              </rsm:SupplyChainTradeTransaction>
            </rsm:CrossIndustryInvoice>
            XML
            curl http://localhost:3000/forms/pdf/remediate -F files=@invoice-print.pdf -F files=@invoice.xml -F profile=Factur-X -F xml=invoice.xml -F level=MINIMUM -o invoice.pdf
        - lang: Shell
          label: marqius-kern run (a Factur-X invoice), no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o invoice-print.pdf
            cat > invoice.xml <<'XML'
            <?xml version="1.0" encoding="UTF-8"?>
            <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
              <rsm:ExchangedDocumentContext>
                <ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter>
              </rsm:ExchangedDocumentContext>
              <rsm:ExchangedDocument>
                <ram:ID>INV-2026-001</ram:ID>
                <ram:TypeCode>380</ram:TypeCode>
                <ram:IssueDateTime><udt:DateTimeString format="102">20261130</udt:DateTimeString></ram:IssueDateTime>
              </rsm:ExchangedDocument>
              <rsm:SupplyChainTradeTransaction>
                <ram:ApplicableHeaderTradeAgreement>
                  <ram:SellerTradeParty>
                    <ram:Name>Example Ltd</ram:Name>
                    <ram:SpecifiedLegalOrganization><ram:ID>123456789</ram:ID></ram:SpecifiedLegalOrganization>
                    <ram:PostalTradeAddress><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
                    <ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">FR32123456789</ram:ID></ram:SpecifiedTaxRegistration>
                  </ram:SellerTradeParty>
                  <ram:BuyerTradeParty><ram:Name>Client SA</ram:Name></ram:BuyerTradeParty>
                </ram:ApplicableHeaderTradeAgreement>
                <ram:ApplicableHeaderTradeDelivery/>
                <ram:ApplicableHeaderTradeSettlement>
                  <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
                  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                    <ram:TaxBasisTotalAmount>100.00</ram:TaxBasisTotalAmount>
                    <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
                    <ram:GrandTotalAmount>120.00</ram:GrandTotalAmount>
                    <ram:DuePayableAmount>120.00</ram:DuePayableAmount>
                  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                </ram:ApplicableHeaderTradeSettlement>
              </rsm:SupplyChainTradeTransaction>
            </rsm:CrossIndustryInvoice>
            XML
            marqius-kern run /forms/pdf/remediate -F files=@invoice-print.pdf -F files=@invoice.xml -F profile=Factur-X -F xml=invoice.xml -F level=MINIMUM -o invoice.pdf
        - lang: Python
          label: Python (a Factur-X invoice)
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("invoice-print.pdf", "wb") as f:
                f.write(r.content)

            with open("invoice.xml", "w") as f:
                f.write('''<?xml version="1.0" encoding="UTF-8"?>
            <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
              <rsm:ExchangedDocumentContext>
                <ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter>
              </rsm:ExchangedDocumentContext>
              <rsm:ExchangedDocument>
                <ram:ID>INV-2026-001</ram:ID>
                <ram:TypeCode>380</ram:TypeCode>
                <ram:IssueDateTime><udt:DateTimeString format="102">20261130</udt:DateTimeString></ram:IssueDateTime>
              </rsm:ExchangedDocument>
              <rsm:SupplyChainTradeTransaction>
                <ram:ApplicableHeaderTradeAgreement>
                  <ram:SellerTradeParty>
                    <ram:Name>Example Ltd</ram:Name>
                    <ram:SpecifiedLegalOrganization><ram:ID>123456789</ram:ID></ram:SpecifiedLegalOrganization>
                    <ram:PostalTradeAddress><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
                    <ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">FR32123456789</ram:ID></ram:SpecifiedTaxRegistration>
                  </ram:SellerTradeParty>
                  <ram:BuyerTradeParty><ram:Name>Client SA</ram:Name></ram:BuyerTradeParty>
                </ram:ApplicableHeaderTradeAgreement>
                <ram:ApplicableHeaderTradeDelivery/>
                <ram:ApplicableHeaderTradeSettlement>
                  <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
                  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                    <ram:TaxBasisTotalAmount>100.00</ram:TaxBasisTotalAmount>
                    <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
                    <ram:GrandTotalAmount>120.00</ram:GrandTotalAmount>
                    <ram:DuePayableAmount>120.00</ram:DuePayableAmount>
                  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                </ram:ApplicableHeaderTradeSettlement>
              </rsm:SupplyChainTradeTransaction>
            </rsm:CrossIndustryInvoice>
            ''')

            r = requests.post("http://localhost:3000/forms/pdf/remediate", files=[
                ("files", ("invoice-print.pdf", open("invoice-print.pdf", "rb"))),
                ("files", ("invoice.xml", open("invoice.xml", "rb"))),
                ("profile", (None, "Factur-X")),
                ("xml", (None, "invoice.xml")),
                ("level", (None, "MINIMUM")),
            ])
            r.raise_for_status()
            with open("invoice.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript (a Factur-X invoice)
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("invoice-print.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await writeFile("invoice.xml", `<?xml version="1.0" encoding="UTF-8"?>
            <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
              <rsm:ExchangedDocumentContext>
                <ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter>
              </rsm:ExchangedDocumentContext>
              <rsm:ExchangedDocument>
                <ram:ID>INV-2026-001</ram:ID>
                <ram:TypeCode>380</ram:TypeCode>
                <ram:IssueDateTime><udt:DateTimeString format="102">20261130</udt:DateTimeString></ram:IssueDateTime>
              </rsm:ExchangedDocument>
              <rsm:SupplyChainTradeTransaction>
                <ram:ApplicableHeaderTradeAgreement>
                  <ram:SellerTradeParty>
                    <ram:Name>Example Ltd</ram:Name>
                    <ram:SpecifiedLegalOrganization><ram:ID>123456789</ram:ID></ram:SpecifiedLegalOrganization>
                    <ram:PostalTradeAddress><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
                    <ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">FR32123456789</ram:ID></ram:SpecifiedTaxRegistration>
                  </ram:SellerTradeParty>
                  <ram:BuyerTradeParty><ram:Name>Client SA</ram:Name></ram:BuyerTradeParty>
                </ram:ApplicableHeaderTradeAgreement>
                <ram:ApplicableHeaderTradeDelivery/>
                <ram:ApplicableHeaderTradeSettlement>
                  <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
                  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                    <ram:TaxBasisTotalAmount>100.00</ram:TaxBasisTotalAmount>
                    <ram:TaxTotalAmount currencyID="EUR">20.00</ram:TaxTotalAmount>
                    <ram:GrandTotalAmount>120.00</ram:GrandTotalAmount>
                    <ram:DuePayableAmount>120.00</ram:DuePayableAmount>
                  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
                </ram:ApplicableHeaderTradeSettlement>
              </rsm:SupplyChainTradeTransaction>
            </rsm:CrossIndustryInvoice>
            `);

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("invoice-print.pdf")]), "invoice-print.pdf");
              form.append("files", new Blob([await readFile("invoice.xml")]), "invoice.xml");
              form.append("profile", "Factur-X");
              form.append("xml", "invoice.xml");
              form.append("level", "MINIMUM");
              const res = await fetch("http://localhost:3000/forms/pdf/remediate", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("invoice.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/autotag:
    post:
      operationId: pdfAutotag
      summary: Tag PDFs
      description: "Reads untagged pages into a structure screen readers follow: headings, lists, tables, figures, links; running heads as artifacts. A tagged PDF keeps its own tree. Off with `--pdf-disable-routes`."
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/autotag -F files=@a.pdf -o tagged.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/autotag -F files=@a.pdf -o tagged.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/autotag", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("tagged.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/pdf/autotag", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("tagged.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/sign:
    post:
      operationId: pdfSign
      summary: Sign PDFs
      description: "Signs each PDF, as an update added to its end, so that earlier signatures stay valid: PAdES or the classic adbe.pkcs7.detached, time-stamped when an authority is named. Off with `--pdf-disable-routes`."
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                certificate:
                  type: string
                  description: "The name of the identity sent with the request: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key (or the key in `key`); the server's own unless given."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                key:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with its key."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                certificatePassword:
                  type: string
                  description: Opens the store or the key; never logged.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                reason:
                  type: string
                  description: The reason the signature gives.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                location:
                  type: string
                  description: Where it says it was made.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                contactInfo:
                  type: string
                  description: How to reach the signer.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                name:
                  type: string
                  description: The signer's name.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pades:
                  type: boolean
                  description: |-
                    Signs as PAdES; otherwise the classic adbe.pkcs7.detached.

                    Default: `false`.
                  default: false
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                timestampUrl:
                  type: string
                  description: An RFC 3161 authority, http or https, that time-stamps the signature.
                  format: uri
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 1 -subj /CN=Example 2>/dev/null
            curl http://localhost:3000/forms/pdf/sign -F files=@a.pdf -F files=@cert.pem -F files=@key.pem -F certificate=cert.pem -F key=key.pem -F reason=Approved -o signed.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 1 -subj /CN=Example 2>/dev/null
            marqius-kern run /forms/pdf/sign -F files=@a.pdf -F files=@cert.pem -F files=@key.pem -F certificate=cert.pem -F key=key.pem -F reason=Approved -o signed.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import subprocess
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            subprocess.run(["openssl", "req", "-x509", "-newkey", "rsa:2048", "-nodes", "-keyout", "key.pem", "-out", "cert.pem", "-days", "1", "-subj", "/CN=Example"], check=True, capture_output=True)

            r = requests.post("http://localhost:3000/forms/pdf/sign", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("files", ("cert.pem", open("cert.pem", "rb"))),
                ("files", ("key.pem", open("key.pem", "rb"))),
                ("certificate", (None, "cert.pem")),
                ("key", (None, "key.pem")),
                ("reason", (None, "Approved")),
            ])
            r.raise_for_status()
            with open("signed.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";
            import { execFileSync } from "node:child_process";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            execFileSync("openssl", ["req", "-x509", "-newkey", "rsa:2048", "-nodes", "-keyout", "key.pem", "-out", "cert.pem", "-days", "1", "-subj", "/CN=Example"], { stdio: "ignore" });

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("files", new Blob([await readFile("cert.pem")]), "cert.pem");
              form.append("files", new Blob([await readFile("key.pem")]), "key.pem");
              form.append("certificate", "cert.pem");
              form.append("key", "key.pem");
              form.append("reason", "Approved");
              const res = await fetch("http://localhost:3000/forms/pdf/sign", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("signed.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/timestamp:
    post:
      operationId: pdfTimestamp
      summary: Time-stamp PDFs
      description: Adds a document timestamp from an RFC 3161 authority, as an update added to the PDF's end. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Output-Filename"
        - $ref: "#/components/parameters/Gotenberg-Trace"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Url"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Error-Method"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Extra-Http-Headers"
        - $ref: "#/components/parameters/Gotenberg-Webhook-Events-Url"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                timestampUrl:
                  type: string
                  description: The RFC 3161 authority, http or https; the server's own unless given.
                  format: uri
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent).
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent).
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent).

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field.
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60."
                  x-kern-api: kern
                  x-kern-effect: honoured
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: honoured
              required:
                - files
      responses:
        "200":
          description: The PDF; several (a split, or several documents not merged) as a ZIP.
          headers:
            Content-Disposition:
              $ref: "#/components/headers/Content-Disposition"
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
            X-Marqius-Kern-Note:
              $ref: "#/components/headers/X-Marqius-Kern-Note"
            X-Marqius-Kern-Fonts:
              $ref: "#/components/headers/X-Marqius-Kern-Fonts"
          content:
            application/pdf:
              schema:
                type: string
                contentMediaType: application/pdf
            application/zip:
              schema:
                type: string
                contentMediaType: application/zip
        "204":
          $ref: "#/components/responses/Webhook"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "429":
          $ref: "#/components/responses/Status429"
        "500":
          $ref: "#/components/responses/Status500"
        "501":
          $ref: "#/components/responses/Status501"
        "503":
          $ref: "#/components/responses/Status503"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      callbacks:
        result:
          "{$request.header.Gotenberg-Webhook-Url}":
            post:
              summary: The result, sent to your address
              description: Once made, the result is sent here with the method Gotenberg-Webhook-Method names (POST unless PUT or PATCH), its Content-Disposition naming the file, your trace identifier in its header, and the headers of Gotenberg-Webhook-Extra-Http-Headers. The request itself was answered 204 at once.
              requestBody:
                required: true
                content:
                  application/pdf:
                    schema:
                      type: string
                      contentMediaType: application/pdf
                  application/zip:
                    schema:
                      type: string
                      contentMediaType: application/zip
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        error:
          "{$request.header.Gotenberg-Webhook-Error-Url}":
            post:
              summary: A failure, sent to your address
              description: When the request cannot be answered, the status it would have had and why, with Gotenberg-Webhook-Error-Method (POST unless PUT or PATCH).
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookError"
                    example:
                      message: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
                      status: 400
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
        events:
          "{$request.header.Gotenberg-Webhook-Events-Url}":
            post:
              summary: Each outcome, sent to your address
              description: webhook.success once the result is sent, webhook.error once a failure is, each with your trace identifier.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: "#/components/schemas/WebhookEvent"
                    example:
                      correlationId: "4f6c8a3e-2b1d-4c7e-9a5f-1e2d3c4b5a69"
                      event: webhook.success
                      timestamp: "2026-11-30T16:49:15.315Z"
              responses:
                "2XX":
                  description: Received.
                "4XX":
                  description: "Refused: Marqius Kern does not send it again (except after a 429), and logs the request as failed."
                "5XX":
                  description: "Not received: Marqius Kern sends it again (except after a 501), up to --webhook-max-retry times, waiting between --webhook-retry-min-wait and --webhook-retry-max-wait."
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/timestamp -F files=@a.pdf -F timestampUrl=http://timestamp.digicert.com -o timestamped.pdf
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/timestamp -F files=@a.pdf -F timestampUrl=http://timestamp.digicert.com -o timestamped.pdf
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/timestamp", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("timestampUrl", (None, "http://timestamp.digicert.com")),
            ])
            r.raise_for_status()
            with open("timestamped.pdf", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("timestampUrl", "http://timestamp.digicert.com");
              const res = await fetch("http://localhost:3000/forms/pdf/timestamp", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("timestamped.pdf", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/info:
    post:
      operationId: pdfInfo
      summary: Read PDFs' facts
      description: Each PDF's page count, version, size, encryption and form, as JSON by file name. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                password:
                  type: string
                  description: Opens password-protected PDFs.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
              required:
                - files
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                additionalProperties:
                  $ref: "#/components/schemas/PdfInfo"
                description: Each PDF's facts, by file name.
                type: object
              example:
                report.pdf:
                  encrypted: false
                  formFields: false
                  linearized: false
                  pages: 1
                  signed: false
                  tagged: false
                  version: "1.7"
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "500":
          $ref: "#/components/responses/Status500"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/info -F files=@a.pdf -o info.json
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/info -F files=@a.pdf -o info.json
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/info", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("info.json", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/pdf/info", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("info.json", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/metadata:
    post:
      operationId: pdfMetadata
      summary: Read PDFs' metadata
      description: Each PDF's metadata, as JSON by file name. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                password:
                  type: string
                  description: Opens password-protected PDFs.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
              required:
                - files
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                additionalProperties:
                  $ref: "#/components/schemas/PdfMetadata"
                description: Each PDF's metadata, by file name.
                type: object
              example:
                report.pdf:
                  author: Ada
                  creationDate: D:20261130164915Z
                  creator: marqius
                  modDate: D:20261130164915Z
                  producer: marqius 0.12.18
                  title: Quarterly
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "500":
          $ref: "#/components/responses/Status500"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/metadata -F files=@a.pdf -o metadata.json
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/metadata -F files=@a.pdf -o metadata.json
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/metadata", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("metadata.json", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/pdf/metadata", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("metadata.json", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/bookmarks:
    post:
      operationId: pdfBookmarks
      summary: Read PDFs' bookmarks
      description: Each PDF's bookmarks, as JSON by file name. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                password:
                  type: string
                  description: Opens password-protected PDFs.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
              required:
                - files
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                additionalProperties:
                  items:
                    $ref: "#/components/schemas/Bookmark9"
                  type: array
                description: Each PDF's bookmarks, by file name.
                type: object
              example:
                report.pdf:
                  - children:
                      - pageNumber: 1
                        title: Detail
                    pageNumber: 1
                    title: Start
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "500":
          $ref: "#/components/responses/Status500"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/bookmarks -F files=@a.pdf -o bookmarks.json
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/bookmarks -F files=@a.pdf -o bookmarks.json
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/bookmarks", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("bookmarks.json", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              const res = await fetch("http://localhost:3000/forms/pdf/bookmarks", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("bookmarks.json", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/attachments:
    post:
      operationId: pdfAttachments
      summary: List files carried in PDFs
      description: The files each PDF carries, as JSON by file name. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                password:
                  type: string
                  description: Opens password-protected PDFs.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
              required:
                - files
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                additionalProperties:
                  items:
                    $ref: "#/components/schemas/Attachment"
                  type: array
                description: The files each PDF carries, by file name.
                type: object
              example:
                with-note.pdf:
                  - mimeType: text/plain
                    name: note.txt
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "500":
          $ref: "#/components/responses/Status500"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            curl http://localhost:3000/forms/pdf/attach -F files=@a.pdf -F files=@note.txt -F file=note.txt -o with-note.pdf
            curl http://localhost:3000/forms/pdf/attachments -F files=@with-note.pdf -o attachments.json
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            printf 'Shipped on Friday.\n' > note.txt
            marqius-kern run /forms/pdf/attach -F files=@a.pdf -F files=@note.txt -F file=note.txt -o with-note.pdf
            marqius-kern run /forms/pdf/attachments -F files=@with-note.pdf -o attachments.json
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            with open("note.txt", "w") as f:
                f.write("Shipped on Friday.\n")

            r = requests.post("http://localhost:3000/forms/pdf/attach", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("files", ("note.txt", open("note.txt", "rb"))),
                ("file", (None, "note.txt")),
            ])
            r.raise_for_status()
            with open("with-note.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/attachments", files=[
                ("files", ("with-note.pdf", open("with-note.pdf", "rb"))),
            ])
            r.raise_for_status()
            with open("attachments.json", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            await writeFile("note.txt", "Shipped on Friday.\n");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("files", new Blob([await readFile("note.txt")]), "note.txt");
              form.append("file", "note.txt");
              const res = await fetch("http://localhost:3000/forms/pdf/attach", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("with-note.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("with-note.pdf")]), "with-note.pdf");
              const res = await fetch("http://localhost:3000/forms/pdf/attachments", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("attachments.json", Buffer.from(await res.arrayBuffer()));
            }
  /forms/pdf/form:
    post:
      operationId: pdfForm
      summary: Read PDF forms
      description: Each PDF's form fields, their kinds, values and choices, as JSON by file name. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                password:
                  type: string
                  description: Opens password-protected PDFs.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                pages:
                  type: string
                  description: "Only the fields on these pages: 1-3,5."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
              required:
                - files
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                additionalProperties:
                  items:
                    $ref: "#/components/schemas/FormField"
                  type: array
                description: Each PDF's form fields, by file name.
                type: object
              example:
                form.pdf:
                  - name: name
                    pages:
                      - 1
                    type: text
                    value: ""
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "500":
          $ref: "#/components/responses/Status500"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: "cat > form.pdf <<'PDF'\n%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\nPDF\ncurl http://localhost:3000/forms/pdf/form -F files=@form.pdf -o form.json"
        - lang: Shell
          label: marqius-kern run, no server
          source: "cat > form.pdf <<'PDF'\n%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\nPDF\nmarqius-kern run /forms/pdf/form -F files=@form.pdf -o form.json"
        - lang: Python
          label: Python
          source: "# Python 3 with requests (pip install requests)\nimport requests\n\nwith open(\"form.pdf\", \"w\") as f:\n    f.write('''%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\n''')\n\nr = requests.post(\"http://localhost:3000/forms/pdf/form\", files=[\n    (\"files\", (\"form.pdf\", open(\"form.pdf\", \"rb\"))),\n])\nr.raise_for_status()\nwith open(\"form.json\", \"wb\") as f:\n    f.write(r.content)"
        - lang: JavaScript
          label: JavaScript
          source: "// Node 18 or later: save as sample.mjs, then run node sample.mjs\nimport { readFile, writeFile } from \"node:fs/promises\";\n\nawait writeFile(\"form.pdf\", `%PDF-1.7\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [4 0 R] /DA (/Helv 12 Tf 0 g) /DR << /Font << /Helv 5 0 R >> >> >> >>\nendobj\n2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Annots [4 0 R] /Contents 6 0 R /Resources << /Font << /Helv 5 0 R >> >> >>\nendobj\n4 0 obj\n<< /Type /Annot /Subtype /Widget /FT /Tx /T (name) /V () /Rect [72 700 372 728] /P 3 0 R /F 4 /DA (/Helv 12 Tf 0 g) /MK << /BC [0 0 0] >> >>\nendobj\n5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>\nendobj\n6 0 obj\n<< /Length 43 >>\nstream\nBT /Helv 14 Tf 72 740 Td (Your name:) Tj ET\nendstream\nendobj\nxref\n0 7\n0000000000 65535 f \n0000000009 00000 n \n0000000146 00000 n \n0000000203 00000 n \n0000000347 00000 n \n0000000503 00000 n \n0000000600 00000 n \ntrailer\n<< /Size 7 /Root 1 0 R >>\nstartxref\n693\n%%EOF\n`);\n\n{\n  const form = new FormData();\n  form.append(\"files\", new Blob([await readFile(\"form.pdf\")]), \"form.pdf\");\n  const res = await fetch(\"http://localhost:3000/forms/pdf/form\", { method: \"POST\", body: form });\n  if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);\n  await writeFile(\"form.json\", Buffer.from(await res.arrayBuffer()));\n}"
  /forms/pdf/validate:
    post:
      operationId: pdfValidate
      summary: Check PDFs against a standard
      description: Checks each PDF against a PDF/A, PDF/UA or Factur-X profile, with rules named as veraPDF names them, as JSON by file name. Off with `--pdf-disable-routes`.
      tags:
        - PDF (Gotenberg 9)
      x-kern-api: gotenberg-9.10.3
      parameters:
        - $ref: "#/components/parameters/Gotenberg-Trace"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: "The PDFs, taken in the order of their names (numbers compared as numbers), and the files an operation names: a picture, a PDF to insert, an invoice's XML."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                archives:
                  type: array
                  items:
                    type: string
                    format: binary
                    contentMediaType: application/octet-stream
                  description: ZIP files whose contents are taken as if each file had been sent itself.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                profile:
                  type: string
                  description: "The profile checked: a PDF/A level, PDF/UA-1 or 2, or Factur-X; sent twice, or as a JSON pair, for PDF/A with PDF/UA."
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                password:
                  type: string
                  description: Opens password-protected PDFs.
                  x-kern-api: gotenberg-9.10.3
                  x-kern-effect: honoured
                downloadFrom:
                  type: string
                  contentMediaType: application/json
                  description: "Files to fetch first, as if they had been sent with the request: a list of objects with a `url` and, optionally, `extraHttpHeaders` and `embedded` (true: carried inside the PDF as an attachment). Fetched as the server's `--api-download-from-*` rules allow."
                  x-kern-api: gotenberg-8.40.0
                  x-kern-effect: honoured
                kernSign:
                  type: boolean
                  description: Signs the PDFs with the server's key (--kern-sign-certificate); false leaves them unsigned on a server that signs every PDF (--kern-sign-all, which is the default unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  examples:
                    - false
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificate:
                  type: string
                  description: "The name of a file sent with the request to sign with: a PKCS #12 store (.p12, .pfx), or a PEM certificate with its key, or with the key in kernSignKey. The file is taken out of the request's files: never converted, and gone from the disk at once. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignKey:
                  type: string
                  description: "With a PEM certificate that holds no key: the name of the file sent with the key. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignCertificatePassword:
                  type: string
                  description: Opens the store or the key; never logged, never echoed. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignReason:
                  type: string
                  description: The reason the signature gives (the server's --kern-sign-reason unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignLocation:
                  type: string
                  description: Where the signature says it was made (the server's --kern-sign-location unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignContactInfo:
                  type: string
                  description: How to reach the signer (the server's --kern-sign-contact-info unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignName:
                  type: string
                  description: The signer's name, as the signature gives it (the server's --kern-sign-name unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignPades:
                  type: boolean
                  description: |-
                    Signs as PAdES; false: the classic adbe.pkcs7.detached (the server's --kern-sign-pades unless sent). Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.

                    Default: `true`.
                  default: true
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignTimestampUrl:
                  type: string
                  description: An RFC 3161 time-stamp authority, http or https, that stamps the signature's time (PAdES B-T); the server's --kern-sign-timestamp-url unless sent. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignField:
                  type: string
                  description: Signs the PDF's empty signature field of this name, where that field is drawn; or names the new field. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer.
                  x-kern-api: kern
                  x-kern-effect: checked
                kernSignBox:
                  type: string
                  description: "Shows the signature in this box: page:left,bottom,width,height in points, the page 1, 2... or last, such as 1:36,36,200,60. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  x-kern-api: kern
                  x-kern-effect: checked
                kernTimestampUrl:
                  type: string
                  description: "A document timestamp from this RFC 3161 authority, http or https: after the signature when there is one, alone otherwise. Marqius Kern checks the value (a wrong one is refused, in Gotenberg's words); it changes nothing in Marqius Kern's answer."
                  format: uri
                  x-kern-api: kern
                  x-kern-effect: checked
              required:
                - files
                - profile
            encoding:
              profile:
                explode: true
      responses:
        "200":
          description: JSON.
          headers:
            Gotenberg-Trace:
              $ref: "#/components/headers/Gotenberg-Trace"
            Gotenberg-Version:
              $ref: "#/components/headers/Gotenberg-Version"
          content:
            application/json:
              schema:
                additionalProperties:
                  $ref: "#/components/schemas/Validation"
                description: Each PDF's verdict, by file name.
                type: object
              example:
                report.pdf:
                  compliant: false
                  profile: PDF/A-2b
                  violations:
                    - clause: "6.6.4"
                      context: catalog Metadata
                      description: The PDF/A version and conformance level shall be given with the PDF/A identification schema
                      severity: fatal
                      specification: ISO 19005-2:2011
                      testNumber: 1
        "400":
          $ref: "#/components/responses/Status400"
        "401":
          $ref: "#/components/responses/Status401"
        "413":
          $ref: "#/components/responses/Status413"
        "500":
          $ref: "#/components/responses/Status500"
        "404":
          $ref: "#/components/responses/Status404"
      x-kern-disabled-by: "--pdf-disable-routes"
      x-codeSamples:
        - lang: Shell
          label: curl
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            curl http://localhost:3000/forms/chromium/convert/html -F files=@index.html -o a.pdf
            curl http://localhost:3000/forms/pdf/validate -F files=@a.pdf -F profile=PDF/A-2b -o report.json
        - lang: Shell
          label: marqius-kern run, no server
          source: |-
            printf '<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>' > index.html
            marqius-kern run /forms/chromium/convert/html -F files=@index.html -o a.pdf
            marqius-kern run /forms/pdf/validate -F files=@a.pdf -F profile=PDF/A-2b -o report.json
        - lang: Python
          label: Python
          source: |-
            # Python 3 with requests (pip install requests)
            import requests

            with open("index.html", "w") as f:
                f.write("<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>")

            r = requests.post("http://localhost:3000/forms/chromium/convert/html", files=[
                ("files", ("index.html", open("index.html", "rb"))),
            ])
            r.raise_for_status()
            with open("a.pdf", "wb") as f:
                f.write(r.content)

            r = requests.post("http://localhost:3000/forms/pdf/validate", files=[
                ("files", ("a.pdf", open("a.pdf", "rb"))),
                ("profile", (None, "PDF/A-2b")),
            ])
            r.raise_for_status()
            with open("report.json", "wb") as f:
                f.write(r.content)
        - lang: JavaScript
          label: JavaScript
          source: |-
            // Node 18 or later: save as sample.mjs, then run node sample.mjs
            import { readFile, writeFile } from "node:fs/promises";

            await writeFile("index.html", "<!doctype html><html><body><h1>Hello</h1><p>Made by marqius-kern.</p></body></html>");

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("index.html")]), "index.html");
              const res = await fetch("http://localhost:3000/forms/chromium/convert/html", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("a.pdf", Buffer.from(await res.arrayBuffer()));
            }

            {
              const form = new FormData();
              form.append("files", new Blob([await readFile("a.pdf")]), "a.pdf");
              form.append("profile", "PDF/A-2b");
              const res = await fetch("http://localhost:3000/forms/pdf/validate", { method: "POST", body: form });
              if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
              await writeFile("report.json", Buffer.from(await res.arrayBuffer()));
            }
components:
  parameters:
    Gotenberg-Output-Filename:
      name: Gotenberg-Output-Filename
      in: header
      required: false
      schema:
        type: string
      description: "Names the result, without its extension: Marqius Kern adds the right one. Only the name's last part is kept, without control characters."
    Gotenberg-Trace:
      name: Gotenberg-Trace
      in: header
      required: false
      schema:
        type: string
      description: "Your identifier for the request: logged and sent back. One is made up when none is sent. `--api-trace-header` renames the header."
    Gotenberg-Webhook-Url:
      name: Gotenberg-Webhook-Url
      in: header
      required: false
      schema:
        type: string
      description: "Sends the result to this address (http or https) instead of answering with it: the request is answered 204 at once."
    Gotenberg-Webhook-Error-Url:
      name: Gotenberg-Webhook-Error-Url
      in: header
      required: false
      schema:
        type: string
      description: "Where a failure is sent, as {\"status\":…,\"message\":…}. Gotenberg 8.40.0 calls it deprecated for Gotenberg-Webhook-Events-Url; one of the two is required with Gotenberg-Webhook-Url."
    Gotenberg-Webhook-Method:
      name: Gotenberg-Webhook-Method
      in: header
      required: false
      schema:
        type: string
      description: "The method the result is sent with: POST (the default), PUT or PATCH."
    Gotenberg-Webhook-Error-Method:
      name: Gotenberg-Webhook-Error-Method
      in: header
      required: false
      schema:
        type: string
      description: "The method a failure is sent with: POST (the default), PUT or PATCH."
    Gotenberg-Webhook-Extra-Http-Headers:
      name: Gotenberg-Webhook-Extra-Http-Headers
      in: header
      required: false
      schema:
        type: string
      description: A JSON object of headers sent with the result or the failure.
    Gotenberg-Webhook-Events-Url:
      name: Gotenberg-Webhook-Events-Url
      in: header
      required: false
      schema:
        type: string
      description: "Where each outcome is posted too: webhook.success or webhook.error. One of it and Gotenberg-Webhook-Error-Url is required with Gotenberg-Webhook-Url."
  headers:
    Content-Disposition:
      description: "`attachment` and the file's name."
      schema:
        type: string
    Gotenberg-Trace:
      description: Your identifier, or the one made up.
      schema:
        type: string
    Gotenberg-Version:
      description: The version of Gotenberg's API answered (8.40.0). Left out of a 401.
      schema:
        type: string
    X-Marqius-Kern-Note:
      description: "What Marqius Kern did not do or print, when anything: a field with no effect here, a part of a document not printed yet, letters no font had."
      schema:
        type: string
    X-Marqius-Kern-Fonts:
      description: "With kernFontReport or --kern-font-report: the fonts each conversion used, their files, and what stood in for what, as JSON."
      schema:
        type: string
  responses:
    Webhook:
      description: "The request is accepted: its result is sent to Gotenberg-Webhook-Url, or its failure to Gotenberg-Webhook-Error-Url."
    Status400:
      description: A form field or a header is missing or wrong, in Gotenberg's words.
      content:
        text/plain:
          schema:
            type: string
          example: "Invalid form data: form field 'scale' is invalid (got 'foo', resulting to strconv.ParseFloat: parsing \"foo\": invalid syntax)"
    Status401:
      description: The credentials are missing or wrong, with --api-enable-basic-auth on.
      content:
        text/plain:
          schema:
            type: string
    Status403:
      description: "The address lists refuse an address the request makes the server fetch: `Forbidden`; the log says why."
      content:
        text/plain:
          schema:
            type: string
    Status404:
      description: "The route is off on this server, or there is no such route: {\"message\":\"Not Found\"}."
      content:
        application/json:
          schema:
            type: object
    Status409:
      description: "A failOn… check failed (the page or a file it loads answered an error, the console said what the request refuses), or a font the request requires is missing."
      content:
        text/plain:
          schema:
            type: string
    Status413:
      description: The request is larger than --api-body-limit allows.
      content:
        text/plain:
          schema:
            type: string
    Status429:
      description: The queue for this kind of conversion is full; try again shortly.
      content:
        text/plain:
          schema:
            type: string
    Status500:
      description: Something else failed; the request's trace identifier finds it in the log.
      content:
        text/plain:
          schema:
            type: string
    Status501:
      description: What the request asks for, Marqius Kern does not do yet; the answer says what, before any work is done.
      content:
        text/plain:
          schema:
            type: string
    Status503:
      description: The request took longer than --api-timeout, or the server is stopping.
      content:
        text/plain:
          schema:
            type: string
  schemas:
    Attachment:
      properties:
        mimeType:
          type: string
        name:
          type: string
      required:
        - name
      type: object
    Bookmark:
      properties:
        children:
          items:
            $ref: "#/components/schemas/Bookmark"
          type: array
        page:
          minimum: 1
          type: integer
        title:
          type: string
      required:
        - title
        - page
      type: object
    Bookmark9:
      properties:
        children:
          items:
            $ref: "#/components/schemas/Bookmark9"
          type: array
        pageNumber:
          minimum: 1
          type: integer
        title:
          type: string
      required:
        - title
        - pageNumber
      type: object
    FormField:
      properties:
        name:
          type: string
        pages:
          items:
            type: integer
          type: array
        type:
          description: text, checkbox, radio, choice or signature
          type: string
        value:
          description: "The field's value: text, a state's name, or a list for a choice that selects several."
      required:
        - name
        - type
      type: object
    Health:
      properties:
        details:
          additionalProperties:
            properties:
              status:
                enum:
                  - up
                  - down
                type: string
              timestamp:
                format: date-time
                type: string
            type: object
          description: Each engine's state.
          type: object
        status:
          enum:
            - up
            - down
          type: string
      required:
        - status
      type: object
    PdfInfo:
      properties:
        encrypted:
          type: boolean
        formFields:
          type: boolean
        linearized:
          type: boolean
        pages:
          type: integer
        signed:
          type: boolean
        tagged:
          type: boolean
        version:
          type: string
      type: object
    PdfMetadata:
      properties:
        author:
          type: string
        creationDate:
          type: string
        creator:
          type: string
        keywords:
          type: string
        modDate:
          type: string
        producer:
          type: string
        subject:
          type: string
        title:
          type: string
      type: object
    Validation:
      properties:
        compliant:
          type: boolean
        profile:
          type: string
        violations:
          items:
            $ref: "#/components/schemas/Violation"
          type: array
      type: object
    Violation:
      properties:
        clause:
          type: string
        context:
          type: string
        description:
          type: string
        severity:
          type: string
        specification:
          type: string
        testNumber:
          type: integer
      type: object
    WebhookError:
      properties:
        message:
          description: Why, in Gotenberg's words.
          type: string
        status:
          description: The status the request would have been answered.
          type: integer
      required:
        - status
        - message
      type: object
    WebhookEvent:
      properties:
        correlationId:
          description: The request's trace identifier.
          type: string
        error:
          $ref: "#/components/schemas/WebhookError"
        event:
          enum:
            - webhook.success
            - webhook.error
          type: string
        timestamp:
          format: date-time
          type: string
      required:
        - event
        - correlationId
        - timestamp
      type: object
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: With --api-enable-basic-auth (GOTENBERG_API_BASIC_AUTH_USERNAME and _PASSWORD).
