Copy link to clipboard
Copied
I am editing contracts for work, in those contracts there are options to check to get a certain plan within the contract. Is there a way when you select an option that the contract pages below will change to accomadate the option selected.
Copy link to clipboard
Copied
You can set the active page in JavaScript using the following line:
this.pageNum = 9; // go to the 10th page in the document, the first page is page #0
See here for more information from the API documentation: https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/index.html#t=Acro12_MasterBook%...
Copy link to clipboard
Copied
I meant when you check the box, it removes pages not needed within the rest of the contract
Copy link to clipboard
Copied
That is possible, but quite complicated to set up, especially if the file should be used in Reader.
Copy link to clipboard
Copied
How should i go about it?
For example if check box 1 is checked, then remove pages 12-19
This makes it a smaller contract and gets rid of info not needed by the person signing.
Copy link to clipboard
Copied
Do you mean that you need something like this sample document?
https://acrobat.adobe.com/link/track?uri=urn:aaid:scds:US:15749105-a3e2-3fd8-be31-744035973d98
Copy link to clipboard
Copied
Simlilar. The contract im using is 19 pages in all. The first 11 pages have to stay. On page two there are options for how they are going to pay for the contract.
If they select option 1, then pages 12-19 would be taken out as they would not be needed.
Option 2, 14-19 would be taken away.
Option 3, 12-17 and page 19 would be taken away,
Option 4, pages 12-13 would be taken away
Copy link to clipboard
Copied
In this document all pages, except the first, are hidden template pages.
When you click on one of the checkboxes, first it deletes all the pages, except the first, and then it spawns all the selected ones, in the right order.
Deleting all the pages each time has the advantage of not having to manage the location of the pages to be spawned or deleted.
As these are unique pages it doesn't use the automatic renaming of the fields, so all the fields are hidden duplicates in pages templates, so when pages are deleted and re-spawned the fields remain filled, as if the page had not changed.
Copy link to clipboard
Copied
Ok, Thank you ,that should work for what i need. Would you mind sending a generic script so i can paste and modify?
Copy link to clipboard
Copied
var cOPE = event.target.valueAsString;
if (this.numPages > 1) {this.deletePages({nStart: 1, nEnd: this.numPages-1});}
switch (cOPE) {
case "Off": // no sélection
break;
case "souscrip": // souscription
this.getTemplate("P02").spawn({bRename:false});
this.getTemplate("P03").spawn({bRename:false});
this.getTemplate("P04").spawn({bRename:false});
this.getTemplate("P05").spawn({bRename:false});
this.pageNum = 0;
break;
case "arbitrag": // arbitrage
this.getTemplate("P02").spawn({bRename:false});
this.getTemplate("P03").spawn({bRename:false});
this.getTemplate("P06").spawn({bRename:false});
this.getTemplate("P07").spawn({bRename:false});
this.pageNum = 0;
break;
// etc
default:
console.println("unrecognized value");
break;
}
Copy link to clipboard
Copied
Where would i change the data in this script and if so to what?
Copy link to clipboard
Copied
For example the would i leave the "P02" but just enter my page numbers? also what would go in the other fields and which fields would stay the same? Thank you.
Copy link to clipboard
Copied
You can edit orange texts.
You can add or remove any of these lines:
this.getTemplate("P02").spawn({bRename:false});
where "P02" is the name of the template.
Copy link to clipboard
Copied
ok thank you. Last thing could you explain what would go in the orange texts?
Copy link to clipboard
Copied
"could you explain what would go in the orange texts?"
The name of the page template.
Copy link to clipboard
Copied
Good Morning,
Any update on my question below?
Copy link to clipboard
Copied
Read the full reply. It's explained there.
Copy link to clipboard
Copied
It seems to have been answered in full many days ago. If you have further questions, please let us know.