Button to Add Form as Additional Page to PDF

Not sure if that made sense ...

What I'm wanting to do is create a form (done the initial form already) that has a button that instead of just saving the form as a PDF (like it currently does), it will instead just append the data that has been entered as another page either in that PDF or an existing PDF.

Currently we're using a single form as a fact cover sheet where we compile data for 50+ items. And then we go back in and combine them into a single pdf. Which is not that bad, I guess, but I'd rather not do 50+ saves if I can set a button to just keep adding records to the same file.

Hopefully that makes sense.


Jeremy Brown


2 Answers

Hi Jeremy,

If I understand correctly what you want to do, then you might look into using the Page Template Spawning function. Any page in a PDF can be turned into a Template. The Template may contain any kind of regular PDF content or element. The process of creating a new page from the Template is called "spawning". When a Template is spawned, every element on that Template is copied onto a new page. Spawning is done with a script, and only with a script. There are no built-in PDF or Acrobat features for spawning Templates, so you need to get the Acrobat JavaScript Reference and look up the Template object.

I haven't seen any examples of using this anywhere except for the article and sample download we have at www.pdfscripting.com, and that requires a membership fee for access. You may want to do a Google search to see if there are any tutorials/articles/samples somewhere on the web.

Hope this helps,

Dimitri

WindJack Solutions

www.pdfscripting.com

www.windjack.com


Dimitri Munkirs   

Hi Jeremy,

Errors are reported in the Console Window. Did you look there for errors after running the code? The steps you did and your code looks fine. Why are you using this.numPages? The Template is automatically added to the end of the PDF.

Hope this helps,

Dimitri

WindJack Solutions

www.pdfscripting.com

www.windjack.com


Dimitri Munkirs   


Please specify a reason: