As you create and test your document templates, formerly called print templates, use these suggestions to help resolve problems. Most of these solutions apply to document templates with the .docx or PDF file type.
Check for these common syntax issues:
Smart quotes (“”). Make sure only plain quotes ("") are used inside formulas. Formulas won't work correctly with smart quotes.
To disable automatic smart quote formatting, go to File > Options, open the Proofing section, click AutoCorrect Options, go to the AutoFormat tab, and clear the "Straight quotes" with "smart quotes" checkbox. |
Microsoft Word-formatted clauses in a clause library used inside a $startif() function. If you need to use this combination, create a new global variable named print_template_preprocess_startifs and set it to Yes. This eliminates some formatting issues that can occur during processing.
You can also try copying and pasting the entire document into a new Word document to remove ghost formatting.
There are often sections of document templates that need to stay together. For example, you might want to keep all signature lines together on the same page, so that if the preceding text gets too long, the entire signature section jumps to the next page together. You can make sure sections of the template stay together on the same page.
Now, the selected paragraphs will always stay together as a whole.
Refer to Embedding Tables and Fields from Tables for information about including tables. If you're building a complex table, here are some formatting tips for working with tables in Word:
Make sure to use the Format Painter tool to apply a consistent style to your document template. In particular, use the Format Painter to apply a consistent style to formulas, starting at the $
. For example, if you have a $startif formula with an $endif, you should highlight everything from the first $
to the final f
in $endif.
If the document template's final output has style problems, but not the original document template, check the style applied to the text inserted to replace formulas and variables. If the style is different than the rest of the document, you might need to modify that style to make it match the style used in the rest of the text, or apply that style to the text in the original document template. For example, inserting text from an HTML field is often automatically set to the Normal (Web) style in Microsoft Word, while the document template body is usually written in the Normal style. Setting the document template body to Normal (Web) or setting Normal (Web) to the same formatting as Normal can fix this issue.
For best results, store clauses as Microsoft Word files and use the Document Template option to prioritize the template's formatting, instead of Use Global Settings or Field. For complex clauses, or clauses that contain images, set the specific clause to use AltChunk using the customaltchunk=true parameter. If you need a single clause to both use automatic numbering and include an image, the best method is to split the clause into two parts, so that the numbering can be handled using the document template formatting and the image can be handled using AltChunk. |
If the text or list style in the final product still doesn't match the style in the document template, you might need to review the style preference settings for your system, the specific document template, and potentially the individual clause being inserted.
First, if the issue comes from inserting a clause, and the clause is stored in a Microsoft Word file rather than an HTML text field, review the text of the document template to locate the variable pointing to that clause text.
$field_from_other_table(clause,161,clause_ms_word_file, customaltchunk=true)
Next, edit the Word/PDF template itself and check the style preferences drop-down setting at the bottom. This controls the style preference for the whole document template.
Use Global Settings. Follows the settings in the global variables to determine how to format the contents of the selected field.
Document Template. Applies the document template styles to any inserted fields. If a clause contains a bulleted or numbered list, that list is converted to the styles in the document template. This option does not support inserting images from clauses.
Field. Uses Microsoft Word's AltChunk paradigm to embed the field's contents with the field's original styles applied. This option does not support automatic numbering.
Finally, if the lower-level settings weren't the problem, check the global variable settings. Log in as an administrator and go to Setup > System > Manage Global Variables.
Remember that any change to global variable settings affects all document templates in the system, not just the one you're troubleshooting. |
printtemplate
to use the style in the document template, or set it to field to use the style coded in the field.If you set this variable to printtemplate
and you still see problems with styling, check that all the styles used in the document template have the same font and font size. This includes both the problem text and the Microsoft Word style definitions, which you can access by right-clicking the active Style and clicking Modify.
When this variable is set to |
If you set this variable to field
, the formatted contents of an HTML field is retained in the final product. This is generally only used when users copy and paste formatted content from another program like Word directly into the field. If you use this setting, test your document templates thoroughly because Word doesn't recognize all HTML constructs, even if they are correct in HTML.
If you need to include bookmarks in the final product of a Microsoft Word template, you can configure the system to preserve bookmarks from document templates. To do so, go to the Customized Variables tab and select New > Choice Constant. Create a new global variable named print_template_remove_bookmark
and set it to No. This setting applies only to Word document templates, not PDF or HTML formats.
Related articles |