Guide de l'utilisateur
Nitro PDF Pro
Objets JavaScript

OCG object

This object provides support for Optional Content Groups. OCGs hold a collection of graphical objects, and are known as layers. You can dynamically switch properties of layers to make them visible or invisible to provide navigation in a PDF document.

Pour plus d'informations, consultez Le volet Calques .

Propriétés et méthodes

The OCG object supports all properties and methods included in the Acrobat JavaScript specification.

Exemple:

Turns an OCG named ‘Overlay’ on (to turn it off, just change true to false in JavaScript code).

function turnOverlayOCG(doc) { 
var ocgArray = doc.getOCGs();
for(var i=0; i<ocgArray.length){
if(ocgArray[i].name == Overlay){
ocgArray[i].state = true;
}
}
}

Tags
Nitro PDF Pro
Bibliothèque de contenus

Rapport Nitro sur l'état de la productivité à l'horizon 2022

Learn how the pandemic has transformed productivity, workflows and digital initiatives, as well as the trends and technologies shaping work in 2022 and beyon.
Portions of this page translated by Google.