These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Generating document based on user input in a form

pogrom
Registered: May 4 2010
Posts: 10
Answered

Is it possible to create a form that the user would fill with data ant that could click on a button to generate a pre-defined ready document that would have a different layout that the form but would contain the entered data?

For example:

User opens a form wher he is asked to provide his name - John
He enters his name
he clicks [FINISH]
the form opens a PDF document that sais: Hello John!

jonom
Registered: Jan 31 2008
Posts: 133
You can do this using a hidden page - when the button is pressed you hide the current page and show the hidden page.

I've been playing with this idea a bit for forms that look one way while being filled out but look different for printing.
pogrom
Registered: May 4 2010
Posts: 10
And how to hide the entire page? I only managed to hide elements on the page but not the page itsel.
jonom
Registered: Jan 31 2008
Posts: 133
If you hide a subform that takes up an entire page it will hide the page.

In the sample I'm linking to you'll see that I have have hide/show logic on the pre and postprint events of all the pages.

The pages are Half Letter with coloured backgrounds and I've got a second master page that is full size Letter with no background for saving ink on printing. The colour pages hide on preprint while the white page shows and the process gets reversed on postprint.

https://acrobat.com/#d=PzMm8WBYH8kSieI7JPEZyg
--SID--
Registered: May 4 2010
Posts: 31
you can hide the page using the same script as used for objects.

just open your the hierarchy in the designer's view, and that would explain your form's structure.
let's say want to hide the page 5 so you can use

xfa.form.yourFormName.Page5.presence="hidden";

yourFormName is usually the first node in hierarchy

~~ S I D ~~