BentoPDF is configured entirely at build time via environment variables and Docker build arguments. There is no runtime configuration file — values are baked into the compiled JavaScript when you run npm run build or docker build.
Users can override WASM URLs in the app’s Advanced Settings UI at any time. Browser-level overrides take priority over the environment variable defaults.
Build options
| Variable / Build arg | Description | Default |
|---|
SIMPLE_MODE | Hide navigation, hero, FAQ, testimonials, and footer. Shows only the PDF tools. Updates page title to “PDF Tools”. | false |
COMPRESSION_MODE | Controls which compressed asset variants to keep after the build. See table below. | all |
BASE_URL | Root path for subdirectory deployments. Must have both a leading and a trailing slash (e.g., /pdf-tools/). | / |
Compression modes
| Mode | Files kept | Use case |
|---|
g | .gz only | Standard Nginx or minimal image size |
b | .br only | Modern CDN with Brotli support |
o | Originals only | Development or custom compression pipeline |
all | All formats | Maximum browser compatibility (default) |
# Brotli-only build
docker build --build-arg COMPRESSION_MODE=b -t bentopdf:brotli .
# Gzip-only build
docker build --build-arg COMPRESSION_MODE=g -t bentopdf:gzip .
CDN optimization
For production builds, set VITE_USE_CDN=true to load large WASM files (LibreOffice, Ghostscript, PyMuPDF) from jsDelivr CDN with automatic local fallback:
VITE_USE_CDN=true npm run build
The local WASM files are always included — CDN is attempted first and falls back to local files automatically if the CDN is unreachable.
WASM module URLs
These control where the browser fetches the AGPL-licensed processing libraries at runtime. The defaults point to jsDelivr CDN and work out of the box.
| Variable | Description | Default |
|---|
VITE_WASM_PYMUPDF_URL | PyMuPDF WASM module URL. Enables EPUB/MOBI/XPS conversion, image and table extraction. | https://cdn.jsdelivr.net/npm/@bentopdf/pymupdf-wasm@0.11.16/ |
VITE_WASM_GS_URL | Ghostscript WASM module URL. Enables PDF/A conversion, compression, deskewing, rasterization. | https://cdn.jsdelivr.net/npm/@bentopdf/gs-wasm/assets/ |
VITE_WASM_CPDF_URL | CoherentPDF WASM module URL. Enables table of contents, attachments, PDF merge with bookmarks. | https://cdn.jsdelivr.net/npm/coherentpdf/dist/ |
Set a variable to an empty string to disable that module — users will need to configure it manually via Advanced Settings.
# Override for a self-hosted WASM server
docker build \
--build-arg VITE_WASM_PYMUPDF_URL=https://your-server.com/wasm/pymupdf/ \
--build-arg VITE_WASM_GS_URL=https://your-server.com/wasm/gs/ \
--build-arg VITE_WASM_CPDF_URL=https://your-server.com/wasm/cpdf/ \
-t bentopdf .
OCR configuration
OCR (Optical Character Recognition) uses Tesseract.js. Leave all VITE_TESSERACT_* variables empty to use the default online Tesseract CDN assets. To self-host OCR assets, set all three URL variables together — partial overrides are rejected because the worker, core runtime, and traineddata directory must all match.
| Variable | Description | Default |
|---|
VITE_TESSERACT_WORKER_URL | OCR worker script URL (worker.min.js) | (empty; uses Tesseract.js CDN) |
VITE_TESSERACT_CORE_URL | OCR core runtime directory | (empty; uses Tesseract.js CDN) |
VITE_TESSERACT_LANG_URL | OCR traineddata directory | (empty; uses Tesseract.js CDN) |
VITE_TESSERACT_AVAILABLE_LANGUAGES | Comma-separated list of OCR language codes exposed in the UI. If your bundle only includes a subset, set this so the UI only shows bundled languages. | (empty; shows full catalog) |
VITE_OCR_FONT_BASE_URL | Directory serving NotoSans font files for searchable PDF text layers. Required for fully offline OCR output. | (empty; uses remote Noto font URLs) |
# Self-hosted OCR example
docker build \
--build-arg VITE_TESSERACT_WORKER_URL=https://your-server.com/ocr/worker.min.js \
--build-arg VITE_TESSERACT_CORE_URL=https://your-server.com/ocr/core \
--build-arg VITE_TESSERACT_LANG_URL=https://your-server.com/ocr/lang-data \
--build-arg VITE_TESSERACT_AVAILABLE_LANGUAGES=eng,deu,fra \
--build-arg VITE_OCR_FONT_BASE_URL=https://your-server.com/ocr/fonts \
-t bentopdf .
Language
| Variable | Description | Default |
|---|
VITE_DEFAULT_LANGUAGE | Default UI language for first-time visitors. Users can still switch languages — this only sets the initial default. | en |
Supported language codes:
| Code | Language |
|---|
en | English |
ar | Arabic |
be | Belarusian |
fr | French |
de | German |
es | Spanish |
zh | Chinese (Simplified) |
zh-TW | Chinese (Traditional) |
vi | Vietnamese |
tr | Turkish |
id | Indonesian |
it | Italian |
pt | Portuguese |
nl | Dutch |
da | Danish |
# Build with French as the default
docker build --build-arg VITE_DEFAULT_LANGUAGE=fr -t bentopdf .
Branding
Replace the default BentoPDF name, logo, and footer text with your own. Place your logo file in the public/ folder before building.
| Variable | Description | Default |
|---|
VITE_BRAND_NAME | Brand name shown in the header and footer | BentoPDF |
VITE_BRAND_LOGO | Logo path relative to public/ | images/favicon-no-bg.svg |
VITE_FOOTER_TEXT | Custom footer/copyright text | © 2026 BentoPDF. All rights reserved. |
Branding works in both full mode and Simple Mode, and can be combined with any other build-time option.
docker build \
--build-arg VITE_BRAND_NAME="AcmePDF" \
--build-arg VITE_BRAND_LOGO="images/acme-logo.svg" \
--build-arg VITE_FOOTER_TEXT="© 2026 Acme Corp. Internal use only." \
-t acmepdf .
CORS proxy
| Variable | Description | Default |
|---|
VITE_CORS_PROXY_URL | URL for the CORS proxy used by the Digital Signature tool to fetch certificate chains. Passed as a BuildKit secret at build time — never stored in image layers. | (none) |
The Digital Signature tool requires a CORS proxy when the signing certificate requires fetching issuer certificates from external certificate authority URLs (many CA servers do not include CORS headers).
# Pass as a BuildKit secret
export VITE_CORS_PROXY_URL="https://your-worker.workers.dev"
DOCKER_BUILDKIT=1 docker build \
--secret id=VITE_CORS_PROXY_URL,env=VITE_CORS_PROXY_URL \
-t bentopdf .
See WASM Configuration for full instructions on deploying the included Cloudflare CORS proxy Worker.
Setting variables in .env.production
For non-Docker builds, set variables in .env.production before running npm run build:
# .env.production
VITE_WASM_PYMUPDF_URL=https://cdn.jsdelivr.net/npm/@bentopdf/pymupdf-wasm@0.11.16/
VITE_WASM_GS_URL=https://cdn.jsdelivr.net/npm/@bentopdf/gs-wasm/assets/
VITE_WASM_CPDF_URL=https://cdn.jsdelivr.net/npm/coherentpdf/dist/
VITE_TESSERACT_WORKER_URL=
VITE_TESSERACT_CORE_URL=
VITE_TESSERACT_LANG_URL=
VITE_TESSERACT_AVAILABLE_LANGUAGES=
VITE_OCR_FONT_BASE_URL=
VITE_DEFAULT_LANGUAGE=en