# Modifications to BentoPDF v2.8.12 (Jingfa Factory deployment)

This document records all changes made to the original BentoPDF v2.8.12
source release (tag `v2.8.12`, commit f1d685b) for deployment on
jhffa.com, as required by the GNU Affero General Public License v3,
sections 5(a), 6(d) and 13.

Date of all modifications: **2026-11-24**
Modified by: Jingfa Factory (jhffa.com) operations.

## 1. Local WASM / asset self-hosting (new files, no upstream code changed)

The upstream release loads several runtime engines from the jsDelivr CDN.
For an offline-capable, self-contained deployment, the following npm
packages were downloaded from the npm registry and added verbatim under
`public/wasm/` (Vite copies `public/` into the build output unchanged):

| Local path | Package | Version |
|---|---|---|
| `public/wasm/pymupdf/` | `@bentopdf/pymupdf-wasm` | 0.11.16 |
| `public/wasm/gs/` | `@bentopdf/gs-wasm` (assets/) | 0.1.1 |
| `public/wasm/cpdf/` | `coherentpdf` (dist/) | 2.5.5 |
| `public/wasm/ocr/worker.min.js` | `tesseract.js` (dist/worker.min.js) | 7.0.0 |
| `public/wasm/ocr/core/` | `tesseract.js-core` | 7.0.0 |
| `public/wasm/ocr/lang-data/` | `@tesseract.js-data/eng`, `@tesseract.js-data/chi_sim` (4.0.0_best_int) | — |
| `public/wasm/ocr/fonts/` | Noto Sans, NotoSansCJKsc-Regular (OCR text-layer fonts, per upstream `prepare-airgap.sh` manifest) | — |
| `public/wasm/embedpdf/fonts-*@1.0.0/` | `@embedpdf/fonts-jp`, `fonts-kr`, `fonts-sc`, `fonts-tc`, `fonts-arabic`, `fonts-hebrew`, `fonts-latin` | 1.0.0 |

## 2. Build-time configuration (environment variables only)

The build was run in Simple Mode with the upstream-supported
`VITE_*` environment variables (the same variables used by the
upstream `scripts/prepare-airgap.sh` / Dockerfile build args) pointing
at root-relative paths on the deployment origin instead of the CDN:

- `SIMPLE_MODE=true`
- `VITE_WASM_PYMUPDF_URL=/wasm/pymupdf/`
- `VITE_WASM_GS_URL=/wasm/gs/`
- `VITE_WASM_CPDF_URL=/wasm/cpdf/`
- `VITE_TESSERACT_WORKER_URL=/wasm/ocr/worker.min.js`
- `VITE_TESSERACT_CORE_URL=/wasm/ocr/core`
- `VITE_TESSERACT_LANG_URL=/wasm/ocr/lang-data`
- `VITE_TESSERACT_AVAILABLE_LANGUAGES=eng,chi_sim`
- `VITE_OCR_FONT_BASE_URL=/wasm/ocr/fonts`
- `VITE_EMBEDPDF_FONTS_URL=/wasm/embedpdf`

No upstream source file was edited to achieve this; the variables are
the project's documented configuration surface.

## 2a. Source edits to CDN fallback constants

Three source files were edited so that no CDN address remains as a
runtime fallback in the built output. In each case the edited value is
only a fallback used when the corresponding `VITE_*` variable is unset;
the variables in section 2 are always set in this build.

- `src/js/utils/wasm-provider.ts`: the `CDN_DEFAULTS` entries for
  PyMuPDF, Ghostscript and CoherentPDF were changed from
  `cdn.jsdelivr.net` URLs to `/wasm/pymupdf/`, `/wasm/gs/` and
  `/wasm/cpdf/`.
- `src/js/config/editor-fonts.ts`: the EmbedPDF font CDN fallback
  `https://cdn.jsdelivr.net/npm/@embedpdf` was changed to
  `/wasm/embedpdf`.
- `src/js/config/font-mappings.ts`: all 27 OCR font URLs pointing to
  `rawcdn.githack.com` were rewritten to `/wasm/ocr/fonts/<filename>`
  (same file names; only the bundled Noto Sans and NotoSansCJKsc files
  are present locally, matching the bundled OCR languages).

Two external references remain in the source, both inert in this
deployment and left unchanged: the GitHub star-count fetch in
`src/js/main.ts` is compiled out in Simple Mode, and the timestamp
CORS-proxy fallback in `src/js/logic/digital-sign-pdf.ts` activates
only on the vendor's own hostnames. The FreeTSA timestamp-server entry
in `src/js/config/timestamp-tsa.ts` is a user-selected external
service endpoint of the digital-signing tool itself (invoked only when
a user requests a timestamp), not a resource load.

## 3. Post-build markup changes (build output only)

After building, the generated HTML in the deployment output was
processed to remove search-engine directives that point at the
upstream vendor's domain, which are meaningless for a third-party
deployment:

- Removed `<link rel="canonical">` tags whose href points to
  `www.bentopdf.com`.
- Removed `<link rel="alternate" hreflang="...">` tags whose href
  points to `www.bentopdf.com`.
- Removed `og:url` / `og:image` meta tags whose content points to
  `www.bentopdf.com`.
- Removed the generated `sitemap.xml` (it listed only vendor-domain
  URLs).

Vendor footer links (GitHub, social profiles, licensing page) remain
as ordinary user-clicked anchor links; BentoPDF attribution and all
license notices in the source and output are preserved unchanged.

## 4. This file

`MODIFICATIONS.md` itself is an addition, as is the `public/wasm/`
asset tree described in section 1. No other files in the upstream
source tree were modified.

## Addendum 2026-11-24 — Core edition distributed on pdf.jhffa.com

The deployment on pdf.jhffa.com is a subset of the localized build recorded
above: the LibreOffice-WASM component (libreoffice-wasm/) and the
office-to-PDF tool family that depends on it (word/excel/powerpoint/odt/
ods/odp/odg/rtf/wps/wpd/pages/pub/vsd-to-pdf and pdf-workflow, in all
languages) are not distributed, because two of its files exceed the
hosting platform's 25 MiB per-file limit. All references and index
entries for the removed tools were removed from the distributed copy.
No other changes. The complete corresponding source of the localized
build is available at /source/ on the same site.
