Skip to content

Front-end rendering engine ​

Engine modules ​

From 10.0, the front-end rendering engine loads modules on demand. The first load brings in the main module gsdk.wasm (core PDF features, including Redact). Compare, advanced editing, dynamic XFA, and similar capabilities load their side modules when used.

The 32-bit and 64-bit directories each contain the same module set. For bitness selection, see 32-bit and 64-bit. For transfer compression and caching, see Best practices · Transfer compression for front-end rendering engine wasm modules.

ModuleCapabilityDepends on
gsdk.wasmCore PDF features and Redact.None
compare.wasmOverlay Compare.lr.wasm
pageeditor.wasmParagraph-based advanced editor.lr.wasm
touchup.wasmEdit Text and Add Text in the advanced editor.lr.wasm
xfa.wasmDynamic XFA forms.lr.wasm
3d.wasmDisplay and interact with PDF 3D content.None
optimizer.wasmDigital stamp, flatten, and related features.None
lr.wasmLayout Recognition engine. Loaded when a dependent module is triggered.None
Pageformat.wasmHeader & Footer and Watermark.None
docprocess.wasmForm recognition.None

32-bit and 64-bit ​

From 12.0, Foxit PDF SDK for Web ships 64-bit and 32-bit front-end rendering engines. When jr.wasm64 is omitted, the SDK selects one based on whether the browser supports WebAssembly Memory64. Browsers without Memory64 use the 32-bit engine.

For PDFs with many pages or high memory use, 32-bit WebAssembly linear memory can become a bottleneck, so browsers that support Memory64 load the 64-bit engine.

Bitness and the engine root path are set on PDFViewCtrl.PDFViewer constructor option jr. With UIExtension.PDFUI, set the same options under viewerOptions.jr.

Specify bitness ​

Omit jr.wasm64 to use automatic selection. To pin bitness:

javascript
const pdfViewer = new PDFViewCtrl.PDFViewer({
    jr: {
        wasm64: true // true for 64-bit, false for 32-bit
    }
});
javascript
const pdfui = new UIExtension.PDFUI({
    viewerOptions: {
        jr: {
            wasm64: false
        }
    }
});

jr.enginePath points at jr-engine/gsdk (the default relative to libPath). The SDK then enters the 64 or 32 subdirectory from wasm64. Do not set enginePath to those bitness folders themselves.

Resource directories ​

64-bit and 32-bit resources live under:

  • jr-engine/gsdk/64
  • jr-engine/gsdk/32

When self-hosting, deploy both directories. If you deploy only one, set jr.wasm64 to the matching true or false and keep that subdirectory complete. Module roles are listed under Engine modules.

WASM files ship as plain *.wasm. Compression is negotiated by the file server via Accept-Encoding. See Best practices · Transfer compression for front-end rendering engine wasm modules.

Upgrade notes ​

When upgrading from 11.1, if the site still has a single legacy engine directory, auto-selecting 64-bit will miss files under gsdk/64. Add the directories above, or pin jr.wasm64 to the bitness you deployed.