I'd like to create a script that would save the main form (page 1) when completed as a new page with the Field ''date'' and field .time'' as the reference.
The form will be filled twice a day and the pages would be added in the same file for the whole month.
I would probably also save as Flattenfields() to protect the information added on each forms.
page 1 (Empty Form)
page 2 (june 1 - 6h30)
page 3 (june 1 - 10h30)
page 4 (june 2 - 6h30)
Search everywhere, but i couldn't find anything on saving the form in the same file (add page)
Is this going to only be used in Acrobat? Can you install a script on the local machine of each user who is going to use it?
If the answer to either questions is No then you can't do it.
If it's yes then you will need to create a trusted function in a privileged context to extract the page and save it under a new name (and flatten it, if you wish).
It could be used in acrobat and on local machine, but ideally, it would also work on ipads with PDF Expert on other appas if a better choice is offered!
To accomplish your goal, you're not actually going to save a copy of the page the user just completed. Instead, you're going set the values of the data and time fields and then spawn a new blank form in front of it. Use "Organize Pages" to create and hide a blank version of your form then look at the methods around the template object to understand how to spawn a new version of the template page to the location you want.