• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Create button to toggle on off a layer created in indesing

Participant ,
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

1.2K

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
LEGEND ,
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

Votes

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
Participant ,
Jul 16, 2018 Jul 16, 2018

Copy link to clipboard

Copied

Can you help me with simpler way, thanks

Votes

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
LEGEND ,
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.

Votes

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