Create button to toggle on off a layer created in indesing

Explorer ,
Jul 16, 2018 Jul 16, 2018

Copy link to clipboard

Copied

Hello, I have created a indesign file which contains 4 layers, I have export it to PDF,  I want to create button in PDF with Acrobat which can on and off a layer (A), with Java script code...

Thanks...

TOPICS
Acrobat SDK and JavaScript

Views

605

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 16, 2018 Jul 16, 2018

Copy link to clipboard

Copied

If the PDF has what Acrobat calls layers (what the PDF reference calls OCGs - Optional Content Groups), see the following tutorial: https://acrobatusers.com/tutorials/print/creating-and-using-layers-ocgs-with-acrobat-javascript

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 16, 2018 Jul 16, 2018

Copy link to clipboard

Copied

Can you help me with simpler way, thanks

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 16, 2018 Jul 16, 2018

Copy link to clipboard

Copied

LATEST

The simpler way is to set up the button with a Mouse Up action that's set to: Set layer visibility

and select which layer you want to manipulate. This alone won't act as a toggle. For that, you'd either have to use JavaScript, or use two buttons, one right on top of the other, and add additional show/hide field actions, so that when one is shown, the other is hidden. One button would show the layer, and the other would hide it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines