Skip to main content
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 argDescriptionDefault
SIMPLE_MODEHide navigation, hero, FAQ, testimonials, and footer. Shows only the PDF tools. Updates page title to “PDF Tools”.false
COMPRESSION_MODEControls which compressed asset variants to keep after the build. See table below.all
BASE_URLRoot path for subdirectory deployments. Must have both a leading and a trailing slash (e.g., /pdf-tools/)./

Compression modes

ModeFiles keptUse case
g.gz onlyStandard Nginx or minimal image size
b.br onlyModern CDN with Brotli support
oOriginals onlyDevelopment or custom compression pipeline
allAll formatsMaximum 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.
VariableDescriptionDefault
VITE_WASM_PYMUPDF_URLPyMuPDF 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_URLGhostscript WASM module URL. Enables PDF/A conversion, compression, deskewing, rasterization.https://cdn.jsdelivr.net/npm/@bentopdf/gs-wasm/assets/
VITE_WASM_CPDF_URLCoherentPDF 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.
VariableDescriptionDefault
VITE_TESSERACT_WORKER_URLOCR worker script URL (worker.min.js)(empty; uses Tesseract.js CDN)
VITE_TESSERACT_CORE_URLOCR core runtime directory(empty; uses Tesseract.js CDN)
VITE_TESSERACT_LANG_URLOCR traineddata directory(empty; uses Tesseract.js CDN)
VITE_TESSERACT_AVAILABLE_LANGUAGESComma-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_URLDirectory 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

VariableDescriptionDefault
VITE_DEFAULT_LANGUAGEDefault UI language for first-time visitors. Users can still switch languages — this only sets the initial default.en
Supported language codes:
CodeLanguage
enEnglish
arArabic
beBelarusian
frFrench
deGerman
esSpanish
zhChinese (Simplified)
zh-TWChinese (Traditional)
viVietnamese
trTurkish
idIndonesian
itItalian
ptPortuguese
nlDutch
daDanish
# 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.
VariableDescriptionDefault
VITE_BRAND_NAMEBrand name shown in the header and footerBentoPDF
VITE_BRAND_LOGOLogo path relative to public/images/favicon-no-bg.svg
VITE_FOOTER_TEXTCustom 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

VariableDescriptionDefault
VITE_CORS_PROXY_URLURL 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

Build docs developers (and LLMs) love