Combining pdf forms

Mar 16, 2018

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

179

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Combining pdf forms

Mar 16, 2018

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript

Views

180

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 16, 2018 0
Most Valuable Participant ,
Mar 16, 2018

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 16, 2018 0
Mar 20, 2018

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2018 0
Most Valuable Participant ,
Mar 20, 2018

Copy link to clipboard

Copied

I believe so, yes.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2018 0
Adobe Community Professional ,
Mar 20, 2018

Copy link to clipboard

Copied

Yes, you need Pro for this feature.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2018 0
Mar 20, 2018

Copy link to clipboard

Copied

That's unfortunate. Thank you for help anyway

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 20, 2018 0
Mar 23, 2018

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 23, 2018 0
Most Valuable Participant ,
Mar 23, 2018

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;

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 23, 2018 1
Mar 27, 2018

Copy link to clipboard

Copied

Thank you very much!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 27, 2018 0