Utilizes OpenAI models (cloud-based) to describe images and formulas. Requires an OpenAI API key. For PDF output without watermarks, a PDFix SDK license is required.
You need Docker installed. The first run downloads the image and may take longer than later runs.
Mount a folder into the container and run a subcommand:
docker run --rm -v "$(pwd)":/data -w /data pdfix/pdf-accessibility-openai:v1.3.5 <command> [options]
generate-alt-text: Alternate text for images (PDF → PDF; image/XML → TXT)generate-table-summary: Table summaries (PDF → PDF; image → TXT)generate-mathml: MathML for formulas (PDF → PDF; image → TXT)| Option | Required | Type / expected value | Description |
|---|---|---|---|
--openai-key | yes | String (OpenAI API key) | OpenAI API key |
--input, -i | yes | Path to .pdf, image, or .xml as supported by the command | Input file |
--output, -o | yes | Path to output .pdf, .txt, or .xml as supported | Output file |
--model | no | One of: chat-latest, gpt-4-turbo, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, gpt-4o-mini, gpt-5, gpt-5-mini, gpt-5-nano, gpt-5.2, gpt-5.4-mini, gpt-5.4-nano, gpt-5.5, gpt-5.6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-6-astra, o1, o3, o3-mini, o4-mini (default: gpt-4o-mini) | OpenAI model |
--prompt | no | Prompt text or path to a .txt file | Custom prompt |
--params | for PDF → PDF | Path to a .json file | Tag filter parameters (see Params JSON) |
--tags-count | no | Integer (default 2); PDF only | Surrounding tags in prompt |
--name | no | String (PDFix account license name) | PDFix license name |
--key | no | String (PDFix account license key) | PDFix license key |
generate-alt-text| Option | Required | Type / expected value | Description |
|---|---|---|---|
--lang | no | Language code string (default: en) | Output language |
--overwrite | no | Boolean string (default: false) | Overwrite existing Alt text |
Default tag filter when --params is omitted: Figure|Formula.
generate-table-summary| Option | Required | Type / expected value | Description |
|---|---|---|---|
--lang | no | Language code string (default: en) | Output language |
--overwrite | no | Boolean string (default: false) | Overwrite existing summary |
Default tag filter when --params is omitted: Table.
generate-mathml| Option | Required | Type / expected value | Description |
|---|---|---|---|
--mathml-version | no | One of: mathml-1, mathml-2, mathml-3, mathml-4 (default: mathml-4) | MathML version |
--overwrite | no | Boolean string (default: false) | Overwrite existing output |
Default tag filter when --params is omitted: Formula.
--params points to a JSON array of parameter objects. Each object has at least name and value; the CLI reads those fields to decide which tags to process (PDF → PDF only).
tag_namestag_names is an ECMAScript regular expression matching tag names, or a template tag_update object.
Example (tests/params_alt_text.json) — match Figure or Formula tags:
[
{
"title": "Tags",
"desc": "Specify the tags using a ECMAScript regular expression or define them by template tag_update",
"name": "tag_names",
"type": "tag",
"value": "Figure|Formula",
"values": [
{
"desc": "All tags",
"value": ".*"
}
]
}
]
Use "value": ".*" to match all tags. Command-specific defaults:
| Command | Default tag_names |
|---|---|
generate-alt-text | Figure|Formula |
generate-table-summary | Table |
generate-mathml | Formula |
Generate alternate text:
docker run --rm -v "$(pwd)":/data -w /data pdfix/pdf-accessibility-openai:v1.3.5 \
generate-alt-text --openai-key "${OPENAI_API_KEY}" \
--name "${LICENSE_NAME}" --key "${LICENSE_KEY}" \
--input /data/document.pdf --output /data/out.pdf \
--params /data/tests/params_alt_text.json --lang en --overwrite true
For PDFix SDK licensing or issues, contact [email protected].
Content type
Image
Digest
sha256:ae21ea493…
Size
248.7 MB
Last updated
about 1 month ago
docker pull pdfix/pdf-accessibility-openai