Live editing of Document Templates and Themes in XTRF

Shape your Document Templates and Themes directly in XTRF by using the Smart Template Editor.

You don’t need to be proficient in HTML to create your own Document Templates and Themes in XTRF. No need to install additional software either, as it was with BIRT-4 templates.

Document Templates

XTRF adds another way to shape your Document Templates. While with BIRT-4 Templates you need to refer to external tools and import the end results to XTRF, now you can also use a Smart Templates Editor and preview the outcome.

Creating and editing Document Templates

To access Document Templates, click on the Configuration menu > Templates > Document Templates > Templates tab. HTML-based Document Templates are the ones for which the ‘Rendering engine’ is ‘OpenPDF’.

If you want to edit an existing Template, select one from the list and click on its Edit Icon.

If you want to create a new HTML-based Template:

  • From scratch: click on the Add HTML-based Template button.
  • From an existing Template: Find an active Template, Edit, then click the Copy button. A popup window will appear, where you can rename the Template and save it as new. This is the quickest way to establish new Templates.

Document Template properties

Once you open a Template, you can set up its basic properties.

Template Name - Can be changed at any stage.

Template Type - Specifies the type of a document. Template Type can be chosen from a drop-down list during creation, but cannot be changed later.

Active Template (Yes/No) - ‘Yes’ means that Template can be used by everyone.

Default Template (Yes/No) - ‘Yes’ means this Template will be used by default out of all Templates of this type. There is always one default Template for each type: if not hand-picked, it’s pre-selected by the system.

Localization of Document Templates

In contrast to BIRT-4 Templates, where each language version is a separate template file, HTML Templates in different language versions are just multiple sub-entities of the same Document. You can manage language versions on the ‘Template Designer’ card.

To add a language version, click on the + icon, and then click on the + icons next to languages in the pop-up list. They will be automatically added and ready for editing.

Each language version can be enabled, or disabled, but at least one will always remain enabled. One of the enabled languages can also be set as default for a given Template. A Template always has a default language version. Disabled language versions can be deleted.

When generating or sending documents for your Clients and Vendors, the system will automatically use the language version that matches the preferred language for emails of the recipient. If the required language version of the document is not enabled, the default localization will be used instead.

Note

To utilize language variants properly, from XTRF v9.2 onward, the language of Client Portal’s interface and the preferred language for Client’s emails & documents are separated as individual settings, so make sure all these settings are aligned as needed.

Macros in templates

Macros are a useful tool to establish behavioral patterns, stylistic variations and language settings in document templates. Groovy is the scripting language recognized in XTRF. For those willing to learn and use macros, a simplified user guide in available HERE.

Note

Please make sure NOT to use the 'ReportTemplateService' class in your macros. It does not correspond with current versions of the system and may causes malfunctions in template settings.
Use the 'DocumentTemplateService' class instead.

Smart Template Editor for Document Templates

Create or improve all language versions conveniently in the Smart Template Editor.

The visual template editor is intuitive and accessible, resembling other standard document editors. A similar interface is used in XTRF for editing notification templates, so if you’ve been using it, you’ll have an additional head start.

First off, you can switch between the full screen and window view by clicking on the Screen icon.

The pane on the left is a content editor. Here’s where you can design the body of your Document Template and specify the Theme to use. You can switch between the visual editor and HTML editor at any time by clicking on the buttons in the top-right corner.

The pane on the right is for preview. It shows how the final Document would look with any applied Theme, and on a particular document example. The name of the document is typed in manually: once you start typing, a drop-down with fitting document names appears.

The Theme for preview can be changed in the drop-down menu, so that you can check how your document presents itself using different Themes.

Once you select the document and the Theme, the preview will be rendered automatically in the window on the right.

The preview is equipped with options like table of contents, scaling, page turning, and others available in the Menu.

If you’re satisfied, scroll to the top and click on Save to confirm changes.

Built-in Document Templates

XTRF provides built-in Document Templates for both OpenPDF and BIRT-4 rendering engines. They look nearly identical, so you can select one of the engines of your preference and get the same value.

Document Themes

Themes define the styling of the main body, as well as the header and footer of the Document. You can pre-define multiple Themes and their language variants, as needed.

Creating and editing Document Themes

To access Document Themes, click on the Configuration menu > Templates > Document Templates > Themes tab.

If you want to edit an existing Theme, select one from the list and click on its Edit Icon.

If you want to create a new Theme:

  • From scratch: click on the Add New Theme button.
  • From an existing Theme: Find an active, but not default Theme, Edit, then click the Copy button. A popup window will appear, where you can rename the Theme and save it as new. This is the quickest way to establish new Themes.

Document Theme properties and localization

Same rules apply to Themes as to Templates. Please read the above chapters for reference.

Smart Template Editor for Document Themes

The pane on the left is a content editor. The ‘Theme’ tab shows the content. You can switch between the visual editor and HTML editor at any time by clicking on the buttons in the bottom-right corner.

The ‘Styles’ tab shows the CSS parameters of each Theme.

The ‘Options’ tab helps you set font and background options. (see details below).

The pane on the right is for preview. It shows how the content would look with selected styles. The preview is equipped with options like table of contents, scaling, page turning, and others available in the Menu.

How to set fonts and backgrounds for Themes

Click on the Configuration menu > Templates > Document Templates and click on the respective tab (Fonts or Background).

Uploading Fonts

In the Fonts tab drag the files onto the field or click on Select File to upload them from your hard drive. The list of available fonts is displayed below. Maximum font size is 25 MB.

Selecting the font makes it available for editing within the Theme, but it doesn’t automatically change existing fonts. Use CSS to apply the newly selected font to certain elements. If you want to apply the font to every text in the theme, select the ‘Set font for whole page’ checkbox.

Uploading Background images

In the Background tab drag the image files onto the field or click on Select File to upload them from your hard drive. The list of available images with previews is displayed below. Maximum image size is 5 MB.

Using custom Font and Background

Now click on the Themes tab, Edit the Theme you want, and scroll down to the Theme Designer. In the left pane click on Options.

Select the desired font from the drop-down list and the background from the list of available images. Below the list of image previews you will find further background options. Click on the drop-downs to adjust the background size and repeat patterns.

In the right pane click on the Refresh Icon to see the preview. If you’re satisfied, scroll to the top of the page and click on Save to confirm changes.

Note

Built-in Document Templates pull the logo image in the Theme directly from the Configuration Menu > General Configuration > Branding > Logo tab. If you wish to apply your own logo, change the settings in the Branding configuration or replace the logo file directly in the Themes editor.

Templates

Is this article helpful for you?