Dynamically Generate Student Information Pack from Template

Student Pack is a pack of enrolment and course documents, sent to a student after they enroll for a semester.

The example uses a Coordinator template to bring together multiple separate templates into a single PDF file.

The Coordinator template pre-processes data and uses logic to determine which templates are included in the finished document..

This example in detail

Using a Coordinator template

A Coordinator template is distinguished from normal templates by the <<coordinator:>> directive.

The directive <<ref:templateName.docx>> is used to refer to each template.

In this example, the Coordinator template, StudentPackCOORD.docx references CoverPageTemplate.docxWelcomeLetterTemplate.docx, CodeofConductTemplate.docx, OrientationFlyerTemplate.docx, StudentStatementTemplate.docxCourseDetailsTemplate.docx to generate a student pack.

   

Preprocessing data

A coordinator template can be used to pre-format the data.

The formatted values are assigned to variables which are accessible to all the referenced templates.

Using logic in a Coordinator template

Conditional and repeating logic can be used within Coordinator templates.

In this example, the templates CodeOfConductTemplate.docx and OrientationFlyerTemplate.docx are included in the final output only when the conditional section <<cs_newStudent>> evaluates to true.

Generating either a single PDF file or a ZIP file

This Coordinator example is designed to output a single PDF or a Zip file comprising of two PDF files.

The output format is based on the value of the boolean data field keepCourseInfoSeparate.

When keepCourseInfoSeparate is true, <<coordinator:newFile:CoursesBooklet>> command is executed creating Zip file containing

  1. StudentPackCOORD.pdf with all the templates referred above the command and 
  2. CourseBooklet.pdf with all the templates referred below the command.

Otherwise a single PDF named StudentPackCOORD.pdf is generated from all the referred templates.

Feedback

Invalid Input

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam. Please also consider contacting support@docmosis.com if you need help with this article.

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Invalid Input

Document Gallery

Docmosis showcases its template-based document generation capabilities through a gallery of downloadable PDF documents. The gallery features a mixture of real documents provided by customers as well as links to PDFs generated from example templates, desgined to illustrate the versatility of Docmosis.