Skip to content

Getting Started ​

Foxit PDF SDK for Web is a JavaScript library for embedding PDF viewing and editing in web applications. For product capabilities, architecture details, and use cases, see Foxit PDF SDK for Web overview.

SDK architecture ​

Foxit PDF SDK for Web uses the same three-layer model as the mobile SDK. See the full architecture description for layer details and use cases.

LayerKey objectsRoleTypical use
UI Extension (Full UI)PDFUIFull application UIShip a production-ready web PDF app quickly
PDFViewCtrl (Basic Viewer)PDFViewerViewer control and renderingCustom UI with SDK rendering and interaction
Core SDKPDFDoc, PDFPageLow-level PDF APIsCustom workflows without bundled UI

NOTE

Foxit PDF SDK for Web, the Android SDK, and the iOS SDK are built on top of Foxit PDF SDK for Desktop/Server. Core SDK indicates low-level PDF operations that work without UI. PDFViewCtrl indicates APIs that depend on the viewer control. UI Extension indicates features provided by the built-in UI components.

Download the SDK ​

  • Get the SDK: Request a trial or download instructions from the Foxit Developer Hub, or contact Foxit technical support or your sales representative for the build that fits your project.
  • npm: Visit the SDK package on npm here.

Sample projects ​

  • Local samples: See Examples to build and run sample projects locally and get started with integration.
  • Online demo: Try features in the online demo without deploying anything.

Quick integration ​

Package layout ​

Package changes ​

Before version 10.0, Foxit PDF SDK for Web shipped three package variants:

  • Standard package without fonts (FoxitPDFSDKForWeb_x_xxx_NoFonts.zip):
    • Contains no font resources—for teams that already have fonts or rely on online fonts only.
    • Smaller download size.
  • Standard package (FoxitPDFSDKForWeb_x_xxx.zip):
    • Includes full font resources for immediate use without extra setup.
    • For teams that do not need a custom font setup and accept a larger package.
  • Full package (FoxitPDFSDKForWeb_x_xxx_Full.zip):
    • Adds document compare, advanced editing, dynamic XFA, and other advanced capabilities on top of the standard package.
    • For teams that need those advanced features.

Important update:

Starting with version 10.0, the product ships a single consolidated package:

  • Full package (FoxitPDFSDKForWeb_x_xxx.zip):
    • Includes everything from the previous full package plus 3D support.
    • Feature modules load according to your license, so you enable only what you need.
    • This change delivers broader capability with a simpler package model.

Directory structure ​

Folder / fileDescription
docsAPI reference and the Foxit PDF SDK for Web developer guide.
Note: The HTML developer guide is built with VuePress and cannot be opened by double-clicking a file. Start an HTTP server and open it in a browser. Some interactive samples require WebPDFJRWorker.js and an HTTP-served environment.
examplesDemos and sample projects that show how to use Foxit PDF SDK for Web.
externalFont resources.
libCore Foxit PDF SDK for Web libraries.
serverhttp-server and Node.js scripts used by server-side features in the web viewer.
legal.txtLegal and copyright information.
package.jsonProject metadata.

The lib folder contains:

Folder / fileDescription
jr-engineClient-side rendering engine.
localesSupported languages; resource files are grouped by locale tag.
PDFViewCtrlPDFViewCtrl add-on plugins.
stampsStamp resources—images and templates.
assetsTemplate assets for document compare (included in the full package only).
uix-addonsUIExtension add-on plugins.
PDFViewCtrl.cssCSS for PDFViewCtrl viewer UI.
PDFViewCtrl.full.jsFull PDFViewCtrl viewer script (includes dependencies).
PDFViewCtrl.jsPDFViewCtrl viewer script without bundled third-party libraries.
PDFViewCtrl.polyfills.jsPolyfills used by PDFViewCtrl for browser compatibility.
PDFViewCtrl.vendor.jsThird-party libraries used by PDFViewCtrl (see list below).
preload-jr-worker.jsWorker script that preloads the JS engine to speed up viewer startup.
UIExtension.cssDefault UIExtension CSS.
UIExtension.dark-variable.cssCSS variables for dark theme.
UIExtension.vw.cssCSS that uses vmin units.
UIExtension.full.jsFull UIExtension viewer script (includes dependencies).
UIExtension.jsUIExtension viewer script without bundled third-party libraries.
UIExtension.polyfills.jsPolyfills used by UIExtension for browser compatibility.
UIExtension.vendor.jsThird-party libraries used by UIExtension (see list below).
WebPDFJRWorker.jsWeb Worker script that runs the client-side rendering engine.
WebPDFSRWorker.jsWeb Worker script that runs the server-side rendering engine.
*.d.tsTypeScript declaration files for JavaScript APIs—IDE hints, autocomplete, and compile-time type checks.

Static vs dynamic libraries ​

  • Before v10.0: static library

    • Earlier releases bundled all features into one large .wasm file.
    • Drawback: file size grew with each feature, increasing first-load time.
    • Benefit: after the first load, features did not need to be loaded again.
  • From v10.0: dynamic library

    • Features are split into modules compiled separately.
    • First load pulls in the main module only (e.g. rendering), shortening initial load time.
    • Other modules load on demand when used, improving resource use and performance.

Dynamic library modules ​

Modules are split into a core main module and on-demand side modules.

Core main module:

  • gsdk.wasm

Side modules (loaded on demand):

  • compare.wasm
  • pageeditor.wasm
  • touchup.wasm
  • xfa.wasm
  • 3d.wasm
  • lr.wasm
  • Pageformat.wasm
  • docprocess.wasm
  • optimizer.wasm

Module capabilities and dependencies:

ModuleCapabilityDepends on
gsdk.wasmCore PDF features and Redact.None
compare.wasmRequired for Overlay Compare.lr.wasm
pageeditor.wasmParagraph-based editor (advanced paragraph editing).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 advanced module is triggered.None
Pageformat.wasmHeader & Footer and Watermark.None
docprocess.wasmForm recognition.None

Third-party libraries ​

Foxit PDF SDK for Web ships two JS bundle styles: full builds that include third-party dependencies, and regular builds without them. If your app already includes the same libraries, you do not need to load them again.

PDFViewCtrl.full.js includes:

  • PDFViewCtrl.full.js: Full PDFViewCtrl viewer script.
  • PDFViewCtrl.polyfills.js: Polyfills for browser compatibility.
  • PDFViewCtrl.vendor.js: Third-party libraries (listed below).
  • PDFViewCtrl.js: PDFViewCtrl viewer script without bundled third-party libraries.

Therefore, PDFViewCtrl.polyfills.js + PDFViewCtrl.vendor.js + PDFViewCtrl.js = PDFViewCtrl.full.js.

These two approaches are equivalent:

html
<script src="../FoxitPDFSDKForWeb/lib/PDFViewCtrl.full.js"></script>

and

html
<script src="../FoxitPDFSDKForWeb/lib/PDFViewCtrl.polyfills.js"></script>
<script src="../FoxitPDFSDKForWeb/lib/PDFViewCtrl.vendor.js"></script>
<script src="../FoxitPDFSDKForWeb/lib/PDFViewCtrl.js"></script>

Third-party libraries in PDFViewCtrl.vendor.js:

html
jquery
i18next
i18next-chained-backend
i18next-localstorage-backend
i18next-xhr-backend
jquery-contextmenu
dialog-polyfill
hammerjs
eventemitter3

UIExtension.full.js includes:

  • UIExtension.full.js: Full UIExtension viewer script.
  • UIExtension.polyfills.js: Polyfills for browser compatibility.
  • UIExtension.vendor.js: Third-party libraries (listed below).
  • UIExtension.js: UIExtension viewer script without bundled third-party libraries.

Therefore, UIExtension.polyfills.js + UIExtension.vendor.js + UIExtension.js = UIExtension.full.js.

These two approaches are equivalent:

html
<script src="../FoxitPDFSDKForWeb/lib/UIExtension.full.js"></script>

and

html
<script src="../FoxitPDFSDKForWeb/lib/UIExtension.polyfills.js"></script>
<script src="../FoxitPDFSDKForWeb/lib/UIExtension.vendor.js"></script>
<script src="../FoxitPDFSDKForWeb/lib/UIExtension.js"></script>

Third-party libraries in UIExtension.vendor.js:

html
jquery
i18next
i18next-chained-backend
i18next-localstorage-backend
i18next-xhr-backend
dialog-polyfill
hammerjs
eventemitter3
file-saver