Copy link to clipboard
Copied
This is the first time I use javascript so I'm sorry if the question is just silly. I have three pdf forms (A,B,C) that I want to combine into one file. I would like to have three radiobuttons on the top of the form (A,B and C). Depending on which one would be chosen pdf form A,B or C would be displayed. The question is if there is a possibility to create some kind of panels in Acrobat XI or do I have to add visibility conditions for each object in the form?
You can insert the three files as layers and then show/hide them based on the selection. You will also need to separately show/hide the fields associated with each form, though.
Copy link to clipboard
Copied
You can insert the three files as layers and then show/hide them based on the selection. You will also need to separately show/hide the fields associated with each form, though.
Copy link to clipboard
Copied
Thank you for the reply. I tried to add layers but as far as I see it cannot be done in Acrobat Standard XI (only in Pro). Am I right?
Copy link to clipboard
Copied
I believe so, yes.
Copy link to clipboard
Copied
That's unfortunate. Thank you for help anyway
Copy link to clipboard
Copied
Yes, you need Pro for this feature.
Copy link to clipboard
Copied
Hi, I have another basic question concerning this subject. I have managed to create pdf with layers (named aaa, bbb and ccc). and radiobuttons. I can change visibility of fields by using simple commands in radiobutton actions f.ex
Mouse Up -> Run a JavaScript -> this.getField("Text2").display = display.visible;
Nevertheless I cannot do the same with layers.
I took a shot with
this.getOCGs("aaa").state = true;
however it does not work (
RangeError: Invalid argument value.
Doc.getOCGs:1:Field Group1:Mouse Up)
Could you please show me how such a command should look like?
Copy link to clipboard
Copied
The getOCGs method returns an array with all of the layers, as the name suggests. You can then iterate over that array, looking for a specific one, like this:
var ocgs = this.getOCGs();
for (var i in ocgs) {
if (ocgs.name=="aaa") ocgs.state = true;
}
Copy link to clipboard
Copied
Thank you very much!