Skip to main content
Participant
February 19, 2020
Question

Selecting visible layers in pdf with dropdown button

  • February 19, 2020
  • 0 replies
  • 387 views

Hi, I'm trying to create pdf with two drop down buttons where user can choose language and logo in the top corner of pdf. Basicly I want to select no more that two layers visible at once. Languge layer and logo layer.

For example layers A,B,C,D,E could be languge versions of the form. Layers 1,2,3,4,5 could be logo layers. All combinations between letters and numerics should be able to be chosen.

 

I have tried with this scipt, but all it does is shows one layer at the time. 

 

var layers = this.getOCGs();
var v = event.value;
for (var i = 0; i < this.layers.length; i++) {
if (layers[i].name == "A" && v == "A") {
layers[i].state = true;
}
else if (layers[i].name == "B" && v == "B") {
layers[i].state = true;
}
else {
layers[i].state = false;
}
}

This topic is closed to new replies. Start a new post to keep the conversation going.