For the complete documentation index, see llms.txt. This page is also available as Markdown.
GenerationViewingExtractionFull-API

Layers (OCG) Manipulation - Sample Code

Requirements

These packages are required to use these features in production. Trial keys have unlimited access to all features

Web SDKFull APILive demo

Sample JavaScript code to use Apryse SDK for creating and manipulating PDF layers (also known as Optional Content Groups - OCGs). These samples demonstrate how to create and extract layers, as well as to selectively render them (show, hide) in conforming PDF readers or printers.

Learn more about working with OCGs and our Web SDK.

Implementation steps

To create, extract, show and hide PDF Layers (OCGs) in JavaScript with WebViewer: Step 1: Follow get started in your preferred web stack for WebViewer Step 2: Enable the full API by passing the fullAPI option into the WebViewer constructor Step 3: Add the sample code provided in this guide

This full sample is one of many included in the manual download of WebViewer.