JavaScript Library for PDF Layers (OCGs)

PSPDFKit for Web includes support for toggling the visibility of optional content group (OCG) layers. It offers developers a robust API for programmatic display of OCG layers, as well as a beautiful UI for users to enable and disable layer visibility.

Try for Free Launch Demo

Nutrient SDKs are trusted by world’s most popular applications, including Autodesk, Disney, UBS, Dropbox, IBM, and Lufthansa. Nutrient’s powerful solutions enable seamless integration of PDF editing features into your applications, delivering reliability and efficiency to world-class enterprises.

Information

Working with PDF layers (OCG layers) is available when using the Web SDK in standalone operational mode.

Key Capabilities

  • Built-in UI — Enable or disable OCG layer visibility using the UI

  • Programmatic — Programmatically toggle or lock OCG layer visibility

  • Layer Nesting — Retain the nested hierarchy of OCG layers

  • Extendable — Add form fill, annotation, editing, and more

Guides for OCG Layers

Introduction to PDF Layers (OCGs)
Learn about PDF OCG layers

Show and Hide
How to programmatically hide, show, or lock PDF OCG layers

Built-in UI
Learn how end users can toggle PDF OCG layers with the built-in UI

Free trial

Start your free trial for unlimited access and expert support.