Skip navigation
Mayerchak
Currently Being Moderated

How to set Layer Visibility on Initial View?

Apr 13, 2012 9:21 AM

Tags: #pdf #forms #layers #layer_visibility

I have created some forms that have multiple layers in them. They are several pages long. On page 1 there are 3 radio buttons . . . the user selects their appropriate user type and that turns on the correct layer and turns off the other layers. Unfortunately, if they go to page 2 before clicking one of the butttons, they see all of the layers at once, and it's a jumbled mess.

 

Is there a way to set the default layer visibility so that when you open the PDF, it shows only the layer I want it to? I can't find this in the initial view settings.

 

Thanks in advance for any help provided!

 
Replies
  • Currently Being Moderated
    Apr 13, 2012 10:00 AM   in reply to Mayerchak

    Yes, you can use a document level script to set the state of the OCG, Optonal Content Group or layer, objects intial states.

     

    var nOCG = 0; // number of OCG to display

    // set all OCGs off

    var ocgs = this.getOCGs();

    ocgs[0].initState.constants.states.off;

    // turnon the one OCG for initial view

    ocgs[nOCG].initState.constants.states.on;

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 13, 2012 10:43 AM   in reply to Mayerchak
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points