---
title: "Optimize Nutrient PDF SDK size | Nutrient"
canonical_url: "https://www.nutrient.io/guides/web/knowledge-base/nutrient-size-optimization/"
md_url: "https://www.nutrient.io/guides/web/knowledge-base/nutrient-size-optimization.md"
last_updated: "2026-05-21T17:12:02.303Z"
description: "Learn what contributes to Nutrient Web SDK’s size and how to optimize it with lazy loading, caching, selective features, and CDN hosting."
---

Nutrient Web SDK’s size reflects its comprehensive feature set. This guide explains what contributes to the size and how to optimize it.

## Understanding Nutrient components

Nutrient Web SDK’s size is primarily due to its comprehensive feature set. Key components contributing to the size include the following:

- **Core library** — Contains essential functionality for PDF rendering and manipulation. Includes various modules for different PDF operations.

- **GdPicture module** — A separate WebAssembly (Wasm) module used for document conversion and template population. It’s crucial for Office-to-PDF conversions, among others, and it significantly contributes to the overall size.

- **Localization files** — Supports multiple languages and regions.

## Deep dive into GdPicture

GdPicture is a critical component of Nutrient, especially for document conversion capabilities:

- **Functionality** — Enables conversion of various document formats to PDF, including Office files. Provides template population features for dynamic document generation.

- **Performance characteristics** — Loaded on demand, minimizing initial load times. Uses WebAssembly for efficient execution in the browser.

- **Customization options** — Controls which conversion capabilities to include. Exclude it if conversions such as Office to PDF aren’t required.

### Optimization strategies

To optimize the overall size of the Nutrient Web SDK dependency, use the following approaches:

1. **Lazy loading implementation** — Use dynamic import to load Nutrient only when needed:

   ```javascript

   const NutrientViewer = (await import("@nutrient-sdk/viewer")).default;
   ```

2. **Preloading WebAssembly workers** — After loading the SDK module but before opening a document, call [`NutrientViewer.preloadWorker()`](https://www.nutrient.io/api/web/functions/NutrientViewer.preloadWorker.html) to fetch and compile WebAssembly artifacts in the background. This pairs well with lazy loading — import the module early, preload the worker, and the viewer is ready to render instantly when the user opens a document.

3. **Caching Nutrient assets** — Implement effective caching strategies for Nutrient assets. Use service workers for efficient caching.

4. **Selective feature usage** — If document conversion isn’t needed, exclude the GdPicture module. Use Nutrient’s modular structure to include only necessary features (for example, Office conversion).

5. **CDN hosting for optimal delivery** — Host Nutrient files on a content delivery network (CDN). This reduces load on your main server and improves global access speeds. Use Brotli or Gzip compression for serving Nutrient assets.

For more detail on these techniques, refer to the [performance best practices](https://www.nutrient.io/guides/web/best-practices/performance.md) guide.

## Summary

Nutrient’s modular structure and lazy loading capabilities ensure the SDK doesn’t impact end user performance when properly optimized. For applications using PDF web review and Office-to-PDF conversion, retaining the full library, including the GdPicture module, is recommended.

Nutrient’s architecture loads components on demand, minimizing the actual impact on end user experience. For further assistance with optimizing Nutrient for your specific use case, refer to the [documentation](https://www.nutrient.io/guides/web.md) or contact the [Support team](https://support.nutrient.io/hc/en-us/requests/new).
---

## Related pages

- [How to add a custom toolbar item to display current zoom percentage](/guides/web/knowledge-base/add-custom-zoom-perentage.md)
- [Add Listener Toolbar Item](/guides/web/knowledge-base/add-listener-toolbar-item.md)
- [Add Custom Keyboard Shortcuts](/guides/web/knowledge-base/add-custom-keyboard-shortcuts.md)
- [Change Default Line Width Ink Annotations](/guides/web/knowledge-base/change-default-line-width-ink-annotations.md)
- [Add Signature Initials](/guides/web/knowledge-base/add-signature-initials.md)
- [Add Listener Text Note Annotation](/guides/web/knowledge-base/add-listener-text-note-annotation.md)
- [Blurry Print Resolution](/guides/web/knowledge-base/blurry-print-resolution.md)
- [Default To Cloudy Border](/guides/web/knowledge-base/default-to-cloudy-border.md)
- [Customize Page Indicator](/guides/web/knowledge-base/customize-page-indicator.md)
- [Delete All Annotations](/guides/web/knowledge-base/delete-all-annotations.md)
- [Control Appearance Of Delete Button On Ink Annotations](/guides/web/knowledge-base/control-appearance-of-delete-button-on-ink-annotations.md)
- [Create Highlight Annotations From Text Extraction Technology](/guides/web/knowledge-base/create-highlight-annotations-from-text-extraction-technology.md)
- [Check Password Protected Files](/guides/web/knowledge-base/check-password-protected-files.md)
- [Listen to an annotation’s hover event](/guides/web/knowledge-base/annotations-hover-event.md)
- [Export Ink Annotation Image](/guides/web/knowledge-base/export-ink-annotation-image.md)
- [Deselect Text](/guides/web/knowledge-base/deselect-text.md)
- [Check Document Contains Annotations](/guides/web/knowledge-base/check-document-contains-annotations.md)
- [Keep widget annotation dimensions consistent across devices](/guides/web/knowledge-base/consistent-widget-annotation-dimensions.md)
- [Detect Pspdfkit Ui Loaded](/guides/web/knowledge-base/detect-pspdfkit-ui-loaded.md)
- [Disable Context Menu](/guides/web/knowledge-base/disable-context-menu.md)
- [How to disable text annotation movement in web apps](/guides/web/knowledge-base/disable-text-annotation-movement.md)
- [Disable Resize Of Annotations](/guides/web/knowledge-base/disable-resize-of-annotations.md)
- [Determine Current Layout Mode](/guides/web/knowledge-base/determine-current-layout-mode.md)
- [Focus the delete button in a confirm dialog](/guides/web/knowledge-base/focus-delete-button-in-confirm-modal-component.md)
- [Focus Viewer After Loading](/guides/web/knowledge-base/focus-viewer-after-loading.md)
- [Automatic Annotation Field Tab Ordering](/guides/web/knowledge-base/automatic-annotation-field-tab-ordering.md)
- [Focus Widget Annotation](/guides/web/knowledge-base/focus-widget-annotation.md)
- [Download Exported Document](/guides/web/knowledge-base/download-exported-document.md)
- [Extracting text and cursor position in annotations](/guides/web/knowledge-base/extract-annotation-text-and-retrieve-cursor-position.md)
- [How Do I Prevent Printing Annotations](/guides/web/knowledge-base/how-do-i-prevent-printing-annotations.md)
- [Handling Clicks On Custom Overlays](/guides/web/knowledge-base/handling-clicks-on-custom-overlays.md)
- [Find Ink Annotation For Signature Form Field](/guides/web/knowledge-base/find-ink-annotation-for-signature-form-field.md)
- [Get Entered Document Password](/guides/web/knowledge-base/get-entered-document-password.md)
- [Get Visible Annotations](/guides/web/knowledge-base/get-visible-annotations.md)
- [How Do I Disable Scrolling On Page Edges](/guides/web/knowledge-base/how-do-i-disable-scrolling-on-page-edges.md)
- [How Do I Rotate A Page](/guides/web/knowledge-base/how-do-i-rotate-a-page.md)
- [How Do I Limit The Number Of Annotations](/guides/web/knowledge-base/how-do-i-limit-the-number-of-annotations.md)
- [Resize multiline text fields to avoid overflow](/guides/web/knowledge-base/how-do-i-resize-form-fields.md)
- [Fix errors with unsupported form field actions](/guides/web/knowledge-base/handle-unsupported-form-field-actions.md)
- [Highlight required form fields](/guides/web/knowledge-base/highlight-required-fields.md)
- [How To Create Bookmarks From Outline Elements](/guides/web/knowledge-base/how-to-create-bookmarks-from-outline-elements.md)
- [How Do I Toggle The Theme](/guides/web/knowledge-base/how-do-i-toggle-the-theme.md)
- [Load Pdf Stub From String](/guides/web/knowledge-base/load-pdf-stub-from-string.md)
- [How Do I Zoom To A Specific Value](/guides/web/knowledge-base/how-do-i-zoom-to-a-specific-value.md)
- [Link Text](/guides/web/knowledge-base/link-text.md)
- [License Registered Different Bundle Id](/guides/web/knowledge-base/license-registered-different-bundle-id.md)
- [Iterate over form fields and widgets](/guides/web/knowledge-base/iterate-over-form-fields.md)
- [Image Attachments Lost Stamp Annotation Templates](/guides/web/knowledge-base/image-attachments-lost-stamp-annotation-templates.md)
- [Load Pdf From Stream](/guides/web/knowledge-base/load-pdf-from-stream.md)
- [Prevent Shortcut Printing](/guides/web/knowledge-base/prevent-shortcut-printing.md)
- [Override Ink Signature Dialog](/guides/web/knowledge-base/override-ink-signature-dialog.md)
- [Loading Multiple Files](/guides/web/knowledge-base/loading-multiple-files.md)
- [Load Pdf As Arraybuffer](/guides/web/knowledge-base/load-pdf-as-arraybuffer.md)
- [Disabling automatic synchronization in Nutrient Web SDK](/guides/web/knowledge-base/manual-instant-sync.md)
- [Override User Agent](/guides/web/knowledge-base/override-user-agent.md)
- [Observe Document Editor Visibility](/guides/web/knowledge-base/observe-document-editor-visibility.md)
- [Prevent Editing Content Text Annotation](/guides/web/knowledge-base/prevent-editing-content-text-annotation.md)
- [Persist Currently Edited Note Test](/guides/web/knowledge-base/persist-currently-edited-note-test.md)
- [Process Currently Rendered Pages](/guides/web/knowledge-base/process-currently-rendered-pages.md)
- [Programmatically Navigate To Page](/guides/web/knowledge-base/programmatically-navigate-to-page.md)
- [Read-only forms](/guides/web/knowledge-base/read-only-forms.md)
- [Persist Ink Signatures Across Instances](/guides/web/knowledge-base/persist-ink-signatures-across-instances.md)
- [Render Document Full Height](/guides/web/knowledge-base/render-document-full-height.md)
- [Restore Last Seen Page](/guides/web/knowledge-base/restore-last-seen-page.md)
- [Render Night Mode](/guides/web/knowledge-base/render-night-mode.md)
- [Place Annotation At Visible Center](/guides/web/knowledge-base/place-annotation-at-visible-center.md)
- [Render Page Without Annotations](/guides/web/knowledge-base/render-page-without-annotations.md)
- [Programmatic Comment Annotations](/guides/web/knowledge-base/programmatic-comment-annotations.md)
- [Render Visible Area In Current Page](/guides/web/knowledge-base/render-visible-area-in-current-page.md)
- [Render Watermark When Printing](/guides/web/knowledge-base/render-watermark-when-printing.md)
- [Show Focus Ring Read Only](/guides/web/knowledge-base/show-focus-ring-read-only.md)
- [Overview](/guides/web/knowledge-base/overview.md)
- [Render Page Black White](/guides/web/knowledge-base/render-page-black-white.md)
- [Show Annotations Properties As Tooltip](/guides/web/knowledge-base/show-annotations-properties-as-tooltip.md)
- [Save Modified Pdf To Document Engine](/guides/web/knowledge-base/save-modified-pdf-to-document-engine.md)
- [Rotate Ink Annotation](/guides/web/knowledge-base/rotate-ink-annotation.md)
- [Wait For Element Appear](/guides/web/knowledge-base/wait-for-element-appear.md)
- [Submit Ink Signatures With Form](/guides/web/knowledge-base/submit-ink-signatures-with-form.md)
- [Web Sdk Vs Dws Viewer](/guides/web/knowledge-base/web-sdk-vs-dws-viewer.md)
- [Easily zoom to specific annotations in PDF](/guides/web/knowledge-base/zoom-to-specific-annotation.md)

