Print sections

Print sections) are part of the Print context. They are meant to be printed directly to a printer or a printer stream/spool file, or to a PDF file (see Generating Print output).
The Print context can also be added to Email output as a PDF attachment; see Generating Email output.
When generating output from the Print context, each of the Print sections is added to the output document, one after the other in sequence, for each record.

Pages

Unlike emails and web pages, Print sections can contain multiple pages. Pages are naturally limited by their size and margins. If the content of a section doesn't fit on one page, the overflow goes to the next page. This happens automatically, based on the section's page size and margins; see Page settings: size, margins and bleed.
The minimum number of pages can be set via the Print section properties; see Print section properties.

Although generally the same content elements can be used in all three contexts (see Content elements), the specific characteristics of pages make it possible to use special elements, such as page numbers; see Page numbers .

See Pages for an overview of settings and elements that are specific for pages.

Using headers, footers, tear-offs and repeated elements

In Print sections, there are often elements that need to be repeated across pages, like headers, footers and logos. In addition, some elements should appear on each first page, or only on pages in between the first and the last page, or only on the last page. Examples are a different header on the first page, and a tear-off slip that should show up on the last page.

This is what Master Pages are used for. Master Pages can only be used in the Print context.

See Master Pages for an explanation of how to fill them and how to apply them to different pages.

Using stationery (Media)

When the output of a Print context is meant to be printed on paper that already has graphical and text elements on it (called stationery, or preprinted sheets), you can add a copy of this media, in the form of a PDF file, to the Media folder.

Media can be applied to pages in a Print section, to make them appear as a background to those pages. This ensures that elements added to the Print context will correspond to their correct location on the preprinted media.

Note: When both Media and a Master Page are used on a certain page, they will both be displayed on the Preview tab of the workspace, the Master Page being 'in front' of the Media and the Print section on top. To open the Preview tab, click it at the bottom of the Workspace or select View > Preview View on the menu.

See Media for a further explanation about how to add Media and how to apply them to different pages.

Note: The Media will not be printed, unless this is specifically requested through the printer settings; see Generating Print output.

Copy Fit

Copy Fit is a feature to automatically adjust the font size of text to make it fit the available space. It could be used for the name of a person on a greeting card, for instance, or for the name of a product on a shelf talker. This feature is only available with Box and Div elements in Print sections.

For more information about this feature see Copy Fit.

Adding a Print section

The Print context can contain multiple sections: a covering letter and a policy, for example, or one section that is meant to be attached to an email as a PDF file and another one that is meant to be printed out on paper. When a Print template is created (see Creating a Print template with a Wizard and Print context), only one Print section is added to it, but you can add as many print sections as you need.

To add a section to a context:

  • On the Resources pane, expand the Contexts folder, right-click the Print context , and then click New section.

Note that the new section automatically gets the same properties as the first section.

The first Master Page (see Master Pages) and Media (see Media) will automatically be applied to all pages in the new section, but this can be changed, see Applying a Master Page to a page in a Print section and Applying Media to a page in a Print section.

Note that Print sections always start on a front page. To avoid empty pages between sections, consider combining them into one section, and use page breaks to push content to the next page (see Page breaks).

Tip: Editing PDF files in the Designer is not possible, but when they're used as a section's background, you can add text and other elements, such as a barcode, to them.
The quickest way to create a Print template based on a PDF file is to right-click the PDF file in the Windows Explorer and select Enhance with Connect. Alternatively, start creating a new Print template with a Wizard, using the PDF-based Print template (see Creating a Print template with a Wizard).
To use a PDF file as background image for an existing section, see Using a PDF file or other image as background.

Note: Via a Control Script, sections can be added to a Print context dynamically; see Dynamically adding sections (cloning).

Tip: If you need a whole Print section to be visible in the output only under certain conditions, consider using the Conditional Print Section script wizard; see Conditional Print sections.
You can use the Conditional Content script wizard to hide parts of the content of a section; see Showing content conditionally.

Importing a Print section

To import a section from another template, click File > Import > Connect Resources... in the menu. See: Import Resources dialog.
Remember also to add or import any related source files, such as images.

Note that when the imported Print section replaces a Print section in your template, its context's Color Output and Finishing settings get imported as well. (See Print settings in the Print context and sections.)

Importing a Word file into a section

To import a Word file into a Print section, open the Print section and then click File > Import > Word in the menu.

The following will be added to the template:

  • Image files for each image in the original file. As with other templates, you can place images on the master page if you want them to appear in every document in the same place.

  • A folder to contain the imported image files.

  • A separate .css file in the Stylesheets for every stylesheet that is imported with the MS Word file. The css files are linked to the active section. They can be edited (see Styling your templates with CSS files).

Microsoft Word documents with mail merge fields

If the Microsoft Word document contains mail merge fields, these mail merge fields (or markers) are added to the Data Model of the OL Connect template.

Select File > Add data > From File Data Source to import the corresponding data.

Or create a data mapping configuration to fill the Data Model with actual data.

In the template, the mail merge fields are replaced with expressions. (See: Handlebars expressions.)

  • The brackets from the mail merge fields are converted to double curly braces.

If expressions are not supported in the current section, placeholders and their associated scripts are added instead of expressions.

  • The brackets from the mail merge fields are converted to the @ character.

  • The variable is wrapped with a span element.

  • A user script is created for each data field.

Note: To enable expressions in a section, right-click the section in the Resources pane, select Properties and check the option Evaluate Handlebars expressions. In templates made with OL Connect 2022.1 or older this option is unchecked by default.

Limitations

The conversion of a Word file to a template will most likely not be perfect. Here are some known limitations:

  • If an image is cropped it will appear stretched in OL Connect.

  • The position of an object is incorrect if it is positioned relative to something else (e.g.: 100 points below a paragraph).

  • Text wrapping is not supported in OL Connect. What you see in OL Connect generally corresponds to the layout option "In Line with Text" in MS Word.

  • Lines and borders around objects are not supported.

  • Headers and footers are not supported.

Deleting a Print section

To delete a Print section:

  • On the Resources pane, expand the Contexts folder, expand the Print context, right-click the name of the section, and then click Delete.

Caution: If you don't have a backup of the template, the only way to recover a deleted section, is to click Undo on the Edit menu, until the deleted section is restored. After closing and reopening the template it is no longer possible to restore the deleted context this way.
In the Saving Preferences you can set whether a backup file should be created when you save the template; see Save preferences.

Arranging Print sections

When generating output from the Print context, each of the Print sections is added to the output document, one after the other in sequence, for each record. The sections are added to the output in the order in which they appear on the Resources pane, so changing the order of the sections in the Print context changes the order in which they are outputted to the final document.

To rearrange sections in a context:

  • On the Resources pane, expand the Print context and drag and drop sections to change the order they are in.

  • On the Resources pane, right-click a Print section and click Arrange. In the Arrange Sections dialog you can change the order of the sections by clicking the name of a section and moving it using the Up and Down buttons.

Styling and formatting a Print section

The contents of a Print section can be formatted directly, or styled with Cascading Style Sheets (CSS). See Styling and formatting.

In order for a style sheet to be applied to a specific section, it needs to be included in that section. There are two ways to do this.

Drag & drop a style sheet

  1. Click and hold the mouse button on the style sheet on the Resources pane.

  2. Move the mouse cursor within the Resources pane to the section to which the style sheet should be applied.

  3. Release the mouse button.

Using the Includes dialog

  1. On the Resources pane, right-click the section, then click Includes.

  2. From the File types dropdown, select Stylesheets.

  3. Choose which CSS files should be applied to this section. The available files are listed at the left. Use the arrow buttons to move the files that should be included to the list at the right.

  4. You can also change the order in which the CSS files are read: click one of the included CSS files and use the Up and Down buttons. Note that moving a style sheet up in the list gives it less weight. In case of conflicting rules, style sheets read later will override previous ones.

Note: Style sheets are applied in the order in which they are included in a section. The styles in each following style sheet add up to the styles found in previously read style sheets. When style sheets have a conflicting rule for the same element, class or ID, the last style sheet ‘wins’ and overrides the rule found in the previous style sheet.

Note: Style sheets that are linked to (i.e. included in) a section show a chain icon in the Resources pane (see Resources pane).

Using a PDF file or other image as background

In the Print context, a PDF file can be used as a section's background. It is different from the Media in that the section considers the PDF to be content, so the number of pages in the section will be the same as the number of pages taken from the PDF file.

With this feature it is possible to create a Print template from an arbitrary PDF fileor from a PDF file provided by the DataMapper. Of course, the PDF file itself can't be edited in a Designer template, but when it is used as a section's background, text and other elements, such as a barcode, can be added to it.

Encrypted PDF files are not supported in PDF pass-through mode.

Select a PDF file as background image

To use a PDF file as background image:

  1. On the Resources pane, expand the Print context, right-click the print section and click Background.

    On the Resources pane, expand the Sections folder, right-click the print section and click Background.


  2. Click the downward pointing arrow after Image and select either From Datamapper input or From PDF resource. From Datamapper input uses the active data mapping configuration to retrieve the PDF file that was used as input file, or another type of input file, converted to a PDF file. With this option you don't need to make any other settings; click OK to close the dialog.

  3. For a PDF resource, you have to specify the path. Clicking the Select Image button opens the Select Image dialog (see Select Image dialog).

    Click Resources, Disk or Url, depending on where the image is located.

    • Resources lists the images that are present in the Images folder on the Resources pane.

    • Disk lists image files that reside in a folder on a hard drive that is accessible from your computer. Click the Browse button to select a folder (or an image in a folder).
      As an alternative it is possible to enter the path manually. You can give a local path (e.g. C:\Images\Test.jpg) or use the "file" protocol. The complete syntax of a fully qualified URL with the "file" protocol is: file://<host>/<path>. Note: if the host is "localhost", it can be omitted, resulting in file:///<path>, for example: file:///c:/resources/images/image.jpg.
      If the file is located on another server in your network, the path must contain five slashes after "file:".

      Note: Mapped network drives are usually not accessible to the server. Use a UNC path instead (e.g. file://///myserver/myfolder/file.txt).

    • Url lists image files from a specific web address. Select the protocol (http or https), and then enter a web address (for example, http://www.mysite.com/images/image.jpg).

    Note: If a URL doesn't have a file extension, and the option Save with template is not selected, the Select Image dialog automatically adds the filetype parameter with the file extension as its value (for example: ?filetype=pdf (if it is the first parameter) or &amp;filetype=pdf).
    The filetype, page and nopreview parameters are not sent to the host; they are used internally. Therefore, URLs that rely on one of these parameters cannot be used.

    With an external image, you can check the option Save with template. If this option is checked, the file will be inserted in the Images folder on the Resources pane at the top left.
    If it isn't saved with the template, the image remains external. Note that external images need to be available when the template is merged with a record set to generate output, and that their location should be accessible from the machine on which the template's output is produced. External images are updated (retrieved) at the time the output is generated.

Note: Any non-content features in the original PDF will get stripped out of the original PDF. These include document navigation (outline), local links, hyperlinks, annotations (markup annotations, comments, etc.), digital signatures, multimedia features, interactive forms, and tagged PDF features (marks in the page content will stay, but the logical structure is gone).

Settings for a background image

Once a background image has been selected (see above), you can make settings for it.

If you want to make settings for a previously added background, expand the Sections folder on the Resources pane, right-click the print section and click Background.

  1. Select the PDF's position:

    • Fit to page stretches the PDF to fit the page size.

    • Centered centers the PDF on the page, vertically and horizontally.

    • Absolute places the PDF at a specific location on the page. Use the Top field to specify the distance between the top side of the page and the top side of the PDF, and the Left field to specify the distance between the left side of the page and the left side of the PDF.
      The Top and Left offset can be specified in the usual units of measurement or as a percentage of the page (for example: a Left value of 25% means it will be placed at 25% of the page width).

  2. Set the scale of the width (x) and height (y) of the image as a percentage of the original image. To avoid stretching, check the option Keep aspect ratio and set the scale of the width.

  3. Click one of the options next to Rotation to rotate the image.

  4. Optionally, if the PDF has more than one page, you can set the range of pages that should be used.

    Note: The number of pages in the Print section is automatically adjusted to the number of pages in the PDF file that are being used as the section's background image.

  5. Define a clipped region if the image should be displayed or hidden only in a certain region of the page.

    Tip: This setting is particularly useful when the background PDF has text that is meant to be extracted but should be invisible to the user.

    1. Check the option Clipped region.

    2. Enter the Top, Left, Width and Height of the region. Valid measurement units are: cm, px, in, mm, pc, and pt.

      Note that the Top, Left, Width and Height of the region are relative to the page. They are not affected by any offset, scale, or rotation that may be applied to the image.

    3. Click Invert region to hide the image within the specified region.

      Not inverted:
      Clipping region screenshot

      Inverted:
      Clipping region inverted screenshot

    4. Select whether you want to apply this setting to the first page or to all pages in the selected background image.

    Note: This setting affects only what is visible of the image. The image itself is not changed.

  6. Finally, click OK.

Tip: An alternative to using a PDF as background inside the template is to layer the template (i.e. the PDF output of a Print section) over the background PDF via a Script task in a Workflow process. This is called 'stamping'. In the unusual case where extracting text from the PDF that is the output of a Print section with a PDF background doesn't work, it is recommended to use this method. For more information, see this how-to: Stamping one PDF file on another.

Note: If the PDF doesn't look as expected, it may be missing one or more external fonts. See Providing missing fonts for PDF.

Dynamic backgrounds

To make the background change based on the value of a data field, you may use the Dynamic Background Script Wizard; see Dynamic Print section backgrounds.

Alternatively you could write your own Control Script to set the background; see Control Script: Setting a Print section's background.

The settings in a script take precedence over the settings made in the Print Section Properties dialog.

Setting the binding style for a Print section

In printing, Finishing is the binding style, or the way pages are bound together. Each Print section can have its own Finishing settings, as well as the Print context as a whole; see Setting the binding style for the Print context.

To set the binding style of a Print section:

  1. On the Resources pane, expand the Contexts folder, expand the Print context and right-click the Print section.

  2. Click Finishing.

  3. Choose a Binding style and, if applicable, the number of holes.

Overriding binding styles in a Job Preset

A Job Preset can override the binding styles set for the Print sections and for the Print context as a whole. To bind output in another way than defined in the template’s settings:

  1. Create a Job Preset that overrides the settings of one or more sections: select File > New and see Job Preset for more details.
  2. Select that Job Preset in the Print wizard, or send it to Workflow and select it in the task that creates Print content; see Generating Print output.

Enabling double-sided printing (Duplex, Mixplex)

To print a Print section on both sides of the paper, that Print section needs to have the Duplex printing option to be enabled. This is an option in the Sheet Configuration dialog. (See Sheet Configuration dialog.)

Note: Your printer must support Duplex for this option to work.

To enable Duplex or Mixplex printing:

  1. On the Resources pane, expand the Print context, right-click the print section and click Sheet configuration.

  2. Check Duplex to enable content to be printed on the back of each sheet.

  3. When Duplex printing is enabled, further options become available.

    • Check Omit empty back side for Last or Single sheet to reset a page to Simplex if it has an empty back side. This changes the Duplex job into a Mixplex job. Thus changing a Duplex job into a Mixplex job may reduce volume printing costs as omitted back sides aren't included in the number of printed pages. On the other hand, depending on the printer type it may reduce the print speed as well.
      See also: The consequences of empty back sides for printing and page numbering.

      Note: Use a print format that supports Duplex/Simplex switching to get a proper Mixplex job. PDF is not suitable as it has no device control.

      Print sections always start on a front page. To avoid empty pages between sections, consider combining them into one section, and use page breaks to push content to the next page (see Page breaks).

    • Check Tumble to duplex pages as in a calendar.

    • Check Facing pages to have the side margins switched alternately, so that after printing and binding the pages, they look like in a magazine or book. See Pages to find out how to set a left and right margin on a page.

Note: Master Pages, Media and Duplex printing options can also be set in a Control Script (see Control Scripts and Control Script API). This is especially useful when you need identical sections with different settings.

The consequences of empty back sides for printing and page numbering

In a Duplex job, the last page of a section may be empty since each new section starts on a new sheet. You may wonder what this means for the number of 'print clicks' and for the page numbering.

Note that an empty page is defined as a page that has no content and no Master Page. To suppress the Master Page on otherwise empty back sides, check the option Omit Master Page Back in case of an empty back page for last and single sheets, in the Sheet Configuration dialog. (See Sheet Configuration dialog.)

As of version 2020.2, a page that only has a DataMapper PDF background is no longer seen as empty. This may affect the output of templates created with previous versions.

Print clicks

If a page is empty, but still sent to a printer, it may be counted as a 'click' on the printer.
To avoid this, you could check the Omit empty back side for Last or Single sheet option in the Duplex printing settings. This resets a page to Simplex if it has an empty back side. The resulting print job can then be "mixed plex"; in that contains both simplex and duplex pages.
The omitted back side isn't sent to the printer, so it doesn't count as a print click.
If a page is empty, but not omitted (the Omit empty back side option is not checked) it will still be sent to the printer and may count as a print click.

Page numbers

An empty back side that is omitted from the output does not count in the page numbers either.

If a back side is empty, but not omitted (the Omit empty back side for Last or Single sheet option is not checked) it will be skipped from the page count unless the page numbers continue on the next section (see Configuring page numbers).