Show layers in multiple pages


hello,

 

i have pdf form document 2 pages , 3 layers in second page. idea when choose option of combo box show layer.

 

i working fine document page not 2 pages.

 

my code in combo box this:

 

var layers = this.getocgs(0);

 

if (event.value == "nap") {

    layers[0].state = true;

    layers[1].state = false;

    layers[2].state = false;  

}else if(event.value == "mod"){

    layers[0].state = false;

    layers[1].state = true;

    layers[2].state = false;

}else if(event.value == "nit"){

    layers[0].state = false;

    layers[1].state = false;

    layers[2].state = true;

}else{

    layers[0].state = false;

    layers[1].state = false;

    layers[2].state = false;

}

 

this code working fine page when it's multiple page doesn't work. in debbug console show this:

 

typeerror: layers null

 

please me?

 

thanks in advance!

drop "0" in getocgs call , you'll layers entire file, not first page.

i don't recommend use index numbers in layers array, though. should iterate on it, looking specific layer names. if don't , layer order changes entire code have adjusted...



More discussions in PDF Forms


adobe

Comments

Popular posts from this blog

Reader DC

AdobeIDの作り方

Adobe InDesign CC 2017 has stopped working