Skip to main content
rakeshk21205956
Inspiring
April 12, 2017
Question

I want to add number of pages in a pdf form depending upon the value in the text field...

  • April 12, 2017
  • 1 reply
  • 1039 views

Sir,

I am making a PDF form in Adobe acrobat Pro in which the requirement is to add any number of pages which use inputs in the text field.

Like if the user put  4 then 4 pages should be added , if they put 40 the 40 pages should be added.... i know to add the pages by the spawning method.....

i.e.   var a = this.getTemplate("Template Name");

               a.spawn();

but i am not able to figure out how to add as many pages as specified by the users......

Also second query....

I would like the first page to be number page 1 of 1, then when the user needs a second page it would numbered as Page 1 of 2 and Page 2 of 2   and so on...

Is it possible.

If yes, then plz help.

Thank you

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 12, 2017

It's possible, but you need to think carefully about how it is going to work.

Let's say the user enters "4" into this text field (?), and four pages are spawned. Then they fill in those pages and remember they actually need 6, not 4. So they go back to the text field and change the value. What should happen then? Delete the existing pages (with all of the user's input) and create 6 new ones? Add only two new pages? Reject/ignore this change? etc. This is a complex situation...

try67
Community Expert
Community Expert
April 12, 2017

... And what if they change the number from 4 to 2? Should it delete all 4 pages and add new ones? Delete just the last 2? The first 2? etc.

rakeshk21205956
Inspiring
April 12, 2017

you are right the above situation may arise... but in my case it is little easier as the first page will contain all the data to be inputted in the spawned pages ........ if there is name field in the first page... the spawned page will have the same name fields..... so if user changes his mind from needing 4 pages to 2 then the rest of the pages may be deleted.......... the same case with with addition if they change ffrom 4 to 6 then simply add 2 more pages ... as the field will be populated from the master page (users don't have to input any value in my spawned pages)