# PDF.js 6.1.200 static integration

> Modified distribution notice: these files are not the unmodified upstream
> `pdfjs-dist` package. They were rebundled by the 11DZ Tools project into
> classic IIFE/worker-source assets for direct `file://` use. The upstream
> Apache-2.0 license and bundled third-party notices remain alongside them.

These browser assets were built from `pdfjs-dist@6.1.200` with
`esbuild@0.28.1`:

- `pdfjs-display.iife.min.js` exposes `window.pdfjsLib`.
- `pdfjs-worker-source.js` exposes the self-contained classic worker source as
  `window.__DZ_PDFJS_WORKER_SOURCE__`.

The direct-file worker must be created as a classic Blob worker. Do not set
`type: "module"`:

```js
const workerUrl = URL.createObjectURL(new Blob(
  [window.__DZ_PDFJS_WORKER_SOURCE__],
  { type: 'text/javascript' }
));
const worker = new Worker(workerUrl);
window.pdfjsLib.GlobalWorkerOptions.workerPort = worker;
```

Load PDF bytes directly and preserve the static runtime contract:

```js
const loadingTask = window.pdfjsLib.getDocument({
  data: new Uint8Array(pdfBytes),
  useWorkerFetch: false,
  useWasm: false,
});
```

Reuse one worker while the PDF tool is active. After the loading task and any
render tasks have been destroyed, release the worker resources:

```js
worker.terminate();
URL.revokeObjectURL(workerUrl);
if (window.pdfjsLib.GlobalWorkerOptions.workerPort === worker) {
  window.pdfjsLib.GlobalWorkerOptions.workerPort = null;
}
```

This combination was verified through `file://` in Chrome 149 and Firefox 150.
Both engines rendered the same one-page PDF to a nonblank 480 by 300 canvas
without worker, page, or console errors.

The `third_party_licenses` directory preserves the notices distributed with
the pinned upstream package. Runtime CMap, standard-font, ICC, and Wasm data
files are intentionally not loaded by this static configuration.
