I have a document with multiple layers, and I want to invert the current visibility of layers. How do I do this?
There are a couple of methods that can be used to invert the visibility of layers. The first option is via the Layers pane, which can be opened with the shortcut Ctrl+L:
Once the Layers pane is open, press Ctrl+A to select all layers, then press the spacebar to invert the visibility of layers:
It is also possible to use JavaScript in order to perform this operation, as detailed below:
1. Open PDF-XChange Editor, then press Ctrl+J to open the JavaScript Console.
2. Enter the following JavaScript in the window of the JavaScript Console:
var ocgArray = this.getOCGs();
for (var i=0; i < ocgArray.length; i++) {
ocgArray[i].state = !ocgArray[i].state;
}
3. Once the JavaScript has been added to the JavaScript Console, simply press Ctrl+Enter to run it and invert the current visibility of document layers.
You can contact us by phone, email or our social media accounts — we are here to assist you.