Skip to main content
Mar 16, 2018 4:02 PM UTC
Answered

Combining pdf forms

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?

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Mar 16, 2018 4:24 PM UTC

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.

8 replies

Mar 23, 2018 3:27 PM UTC

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?

Translate
try67
Community Expert
Community Expert
Mar 23, 2018 3:29 PM UTC

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;

}

Translate
Mar 28, 2018 6:33 AM UTC

Thank you very much!

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Mar 16, 2018 4:24 PM UTC

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.

Translate
Mar 20, 2018 11:11 AM UTC

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?

Translate
try67
Community Expert
Community Expert
Mar 20, 2018 11:14 AM UTC

I believe so, yes.

Translate