Insert Image Files into a Template

HotDocs supports referencing graphics with an INSERT instruction in a text templateA word processor or form document that has been converted to HotDocs format so that it can be automated. When in template format, changeable text in the template can be replaced with variables. Other instructions can be added as well, such as instructions that create lists, condition text, and insert other templates. in Microsoft Word only. If you reference a graphic in a WordPerfect template, HotDocs ignores the INSERT instruction.

Using a HotDocs INSERT instructionAn instruction that inserts one template into another. For example, if boilerplate text needs to be used in multiple documents, a template An instruction that inserts the contents of one template into another. For example, if you have boilerplate text you need to use in multiple documents, you can create a template that contains that text and use the Insert intruction in each template that requires the boilerplate text to insert that content. This way, if you need to make a change to the text, you only need to update one template., you can insert image files into a template. HotDocs supports inserting the following image file formats:

  • JPG
  • PNG
  • GIF

Just as with text files, the insert instruction acts as a pointer or reference to the image files. HotDocs does not insert the actual image until it assembles the document. This feature can be very useful if, when you design the template, it is not possible to determine  which particular diagrams, photos, or other graphics files the user needs to specify at document assemblyThe process HotDocs goes through as it processes scripts in the template and merges answers into the document produced from the template. At the end of the assembly process, the user has a document tailored to his or her needs..

For example, say you are a legal secretary drafting a letter to be sent to a client, and any one of several attorneys can sign the letter. Rather than use Word to add or remove signatures once you assemble the document, you can instead include a series of INSERT IMAGE instructions that define the conditions for which signature gets inserted, as in the following:

«IF Attorney Name = "Cathy Bailey"»

«INSERT "cbailey sig.png" IMAGE»

«ELSE IF Attorney Name = "Jim Johnson"»

«INSERT "jjohnson sig.png" IMAGE»

«END IF»

At document assembly, HotDocs inserts the correct signature based on how you answer the Attorney Name question.

When you insert a graphic into a template, following the INSERT instruction and the name of the file, you need to type the IMAGE keyword. This keyword instructs HotDocs that the file that should be inserted is a graphic.

Although you can insert templates or graphics from any location, file names for inserted templates or graphics should be unique if you plan to publish templates for use on HotDocs Server or Cloud ServicesSee HotDocs Cloud Services..

Insert an Image File Located in the Same Template

If you want to insert a graphic already in use in the template, you can do so. HotDocs removes the image from the template, copies it to a DOCX document, and inserts the INSERT Image instruction. An advantage to doing this (rather than inserting the graphic directly) is that you can format the graphic properties within that DOCX template, and have those settings apply to the graphic at the point of insertion. For example, if you want to specify placement, text wrapping, borders, and other effects, you can assign them in the DOCX document, then, when you insert the image, those properties apply at the parent template. If you need to reuse the graphic in other templates, or in other places in the same template, setting these properties on the image in it's DOCX container can save you a lot time.