Page templates are additional pages stored within the PDF (usually an interactive PDF form) that can be appended or shown based on a JavaScript trigger or action within a document. Page templates can be used to create more dynamic PDFs, they are pages that are hidden in the original PDF document and that can be dynamically added to the PDF.

Usually these dynamic PDF documents will be interactive forms, which based on the data filled will need to add a new new page with additional information to display or fill. For instance, a patient form where a second insurance information need to be filled, a contract where an addendum needs to be shown, a tax document that needs an extra page for entering additional deductions. The trigger to add a new page to the PDF form is handled through a JavaScript action, for instance when checking a box or selection a radio button.

PDF Studio 2018 version adds full support for page templates with the ability to create/edit page templates within the document, as well as internal support to handle documents with existing page templates through JavaScript.

How to Create Page Templates

For example: If you wanted to create an inspection form with the option to add additional pages for details you can create a page template of the additional details page and set a button to add additional pages to the PDF as needed.

  1. Open/create a PDF document
    • NOTE: The page you wish to use as a template must already exist in the document
  2. Launch the Page Template dialog by going to Pages Tab -> Templates
  3. Click “Add” and set the options for the page template
    • Name: Name to be used in when calling the page template (i.e. “AddlSurveyDetails”)
    • Visible: Whether or not the page is initially visible within the document. (most often want this set to hidden “unchecked”)
  4. Add JavaScript to the document that will create the new page referencing the page template name set in step 3
    expTplt = getTemplate("AddlSurveyDetails"); 
    expTplt.spawn(insertAtPage,renameFields,overlay);
    • insertAtPage: page number to insert page using 0 based index (i.e. pg 1 = 0, pg 2 = 1, etc…)
    • renameFields: true/false to rename fields on page template being inserted
    • overlay: true = add page on top of existing page / false = create new page
  5. Save document