Copy link to clipboard
Copied
Hi,
I'm not sure if it's even possible but I was hoping to make a Interactive PDF on Indesign where there will be a drop down list at the beginning and whatever answer you pick will determine what the rest of the PDF looks like.
So for example, this list would have two options, and whichever one you choose will subsequently give you a different form to fill out that asks questions particular to the original drop down choice.
It's important that I keep it on the same PDF rather than having two different PDF's.
Also, I have no idea where to start so there isn't anything I can upload to show you what I mean, i'm just hoping the above is enough information to go off.
Like I said, i'm not even sure if it's possible or not, I have the most up to date verison of InDesign if that changes anything.
TIA,
Dan
1. Create pages that you wish to turn into a template.
2. Create a template from those pages, to do that you need to select 'Organize Pages' tool then click on page you wish to turn into a template and from toolbar select 'More' then 'Page templates', now give that template a name and click 'add' now uncheck checkbox next to template name to make template hidden. Now repeat for other pages and remember those template names you will use those in script.
3. Now to make a script. Let's say you name
...Copy link to clipboard
Copied
It's possible with acrobat pro. You can create template pages and then use script in dropdown field to spawn template depending on dropdown choice.
Copy link to clipboard
Copied
I believe I have that with my Creative Cloud subscription.
In your opinion would it be easier to make all the pages needed and then make it interactive after the fact?
Also, I've never scripted anything in my life, is that easy enough to do?
Thanks
Copy link to clipboard
Copied
1. Create pages that you wish to turn into a template.
2. Create a template from those pages, to do that you need to select 'Organize Pages' tool then click on page you wish to turn into a template and from toolbar select 'More' then 'Page templates', now give that template a name and click 'add' now uncheck checkbox next to template name to make template hidden. Now repeat for other pages and remember those template names you will use those in script.
3. Now to make a script. Let's say you named templates 'template1' and 'template2' and dropdown choices are 'Item1' and 'Item2' (you will adapt those to your actual choices and template names),
as 'Validation' script of dropdown field you would use something like this:
if(event.value == "Item1")
this.getTemplate("template1").spawn(this.numPages, false, false);
else if(event.value == "Item2")
this.getTemplate("template2").spawn(this.numPages, false, false);
Make sure you also check 'Commit selected value immediately' in dropdown field properties under 'Option' tab.
Let us know if you need further help.
Copy link to clipboard
Copied
Fantastic, thank you very much
Copy link to clipboard
Copied
Is there a method to determine the precise arrangement of the Template page? Presently, whenever the template page is displayed, it is positioned at the bottom of the document. However, I aim for it to be positioned, for instance, as page 2.
Thank you
Copy link to clipboard
Copied
Replace 'this.numPages' with page number.
Pages start from 0, so page 2 is number 1.
Copy link to clipboard
Copied
Hi. This post has been most useful - thank you! However, I'm trying to add multiple pages in some instances...
For example, if user selects "4-day" from the drop-down then I want templates 2-day and 3-day to also be added.
What would the correct coding be to list more than one template?
Thanks in anticipation
Copy link to clipboard
Copied
Use curly brackets to spawn more than one template, something like this:
if(event.value == "Item1"){
this.getTemplate("template1").spawn(this.numPages, false, false);
this.getTemplate("template2").spawn(this.numPages, false, false);}
Copy link to clipboard
Copied
How woudl you change this to work with a Checkbox? On: Page Spawns, Off: No Page Spawns.
Thanks!
Copy link to clipboard
Copied
For checkbox to spawn: if(event.target.value !== "Off")
Copy link to clipboard
Copied
Hi,
I wonder if you would be able to help as well. I have a similar issue.
There is a Table of Contents and I would like to add a checkbox directly next to each section in the Table of Contents. When the Checkbox is Checked, I need the pages associated with that section Show. When checkbox is unchecked, hide the pages associated with that section.
I hope this is not reduntant, but I looked throughout the community and could not find something similar.
Copy link to clipboard
Copied
This would be a complex thing to do, first you would have to create templates (which would be a lot of work on its own) then you would have to keep track of the pages you spawn because if you spawn more than one section and try to delete pages you will have to be careful with script to know exactly which pages to delete.
Copy link to clipboard
Copied
I am wanting to do this idea but instead I want to have drop downs with the choices "yes" and "no". Basically, I have 4 different items to consider on the form, and based on the selection of "yes" or "no" for each item, the appropriate pages would spawn. How can I adjust your script so that if the user selects "no", nothing happens (the page wouldn't be needed)? Maybe the easiest thing to do is not have them select it, haha.
Copy link to clipboard
Copied
I guess I'm wondering how I can execute the code you wrote but without using the else statement. I just want the user to select "yes" if the item applies (and spawn the pages) and ignore the other items.
Copy link to clipboard
Copied
So don't use 'else' part of the script, just use first condition.