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.
For further explanation about how to apply Media to different pages, see Applying Media to a page in a Print section.
Media will not be printed, unless you want them to; see below.
Per Media, a front and back can be specified and you can specify on what kind of paper the output is meant to be printed on. This includes paper weight, quality, coating and finishing; see Setting Media properties.
Adding Media
To add a Media, right-click the Media folder on the Resources pane and select New Media.
The new Media is of course empty. You can specify two PDF files for the Media: one for the front, and, optionally, another for the back.
Importing Media
To import Media from another template, click File > Import Resources... in the menu. See: Import Resources dialog.
Specifying and positioning Media
Specifying a PDF for the front: the fast way
To quickly select a PDF file for the front of a Media, drag the PDF file from the Windows Explorer to one of the Media. The Select Image dialog opens; select an image and check the option Save with template if you want to insert the image into the Images folder on the Resources pane. (For PDF files selected by URL this option is always checked.)
Alternatively you could first import the PDF file to the Images folder on the Resources pane (using drag & drop) and drag it from there on one of the Media in the Media folder.
Either way, you cannot set any options.
To be able to specify a PDF file for both the front and the back of the Media, and to specify a position for the Media's PDF files, you have to edit the properties of the Media.
Setting Media properties
Media have a number of properties that you can set. You can change the Media's page size and margins (as long as it isn't applied to a section), you can specify a PDF file (or any other type of image file) for both the front and the back of the Media, and you can determine how the virtual stationery should be positioned on the page. This is done as follows:
-
On the Resources pane, expand the Contexts folder, expand the Media folder, right-click the Media and click Properties.
-
Now you can change the name and page size of the Media. Note that it isn't possible to change the page size once the Media is applied to a section. Media can only be applied to sections that have the same size.
-
On the Virtual Stationery tab, you can click the Select Image button to select a PDF image file.
Note: Encrypted PDF files are not supported in PDF pass-through mode. See PDF Options.
- 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 infile:///<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&filetype=pdf
).
Thefiletype
,page
andnopreview
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. -
If the PDF file consists of more than one page, select the desired page.
Note: The number of pages in a PDF file can not be determined via the HTTP and HTTPS protocols. If you wish to use a page other than page 1 in a remote PDF, check the option Save with template; then click OK and reopen the dialog. Next, on the Resources tab, select the PDF, and select a page.
-
Click Finish.
-
For each of the PDF files, select a 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.
-
-
Finally, click OK.
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).
Setting the paper's characteristics
To set a Media's paper characteristics:
-
On the Resources pane, expand the Contexts folder, expand the Media folder, and right-click the Media. Click Characteristics.
-
Specify the paper's characteristics:
-
Media Type: The type of paper, such as Plain, Continuous, Envelope, Labels, Stationery, etc.
-
Weight: The intended weight of the media in grammage (g/m2).
-
Front Coating: The pre-process coating applied to the front surface of the media, such as Glossy, High Gloss, Matte, Satin, etc.
-
Back Coating: The pre-process coating applied to the back surface of the media.
-
Texture: The intended texture of the media, such as Antique, Calenared, Linen, Stipple or Vellum.
-
Grade: The intended grade of the media, such as Gloss-coated paper, Uncoated white paper, etc.
-
Hole Name: A predefined hole pattern that specifies the pre-punched holes in the media, such as R2-generic, R2m-MIB, R4i-US, etc.
-
-
Click OK.
Rename Media
To rename Media:
-
On the Resources pane, expand the Contexts folder, expand the Media folder, right-click the Media and click Rename. Type the new name and click OK.
-
Alternatively, on the Resources pane, expand the Contexts folder, expand the Media folder, right-click the Media and click Properties. Type the new name in the Name field and click OK.
Applying Media to a page in a Print section
Every page in a print section has a natural position: it can be the first page, the last page, one of the pages in between (a 'middle page'), or a single page. For each of those positions, you can set different Media.
To apply Media to specific page positions in a Print section:
-
On the Resources pane, expand the Print context; right-click the Print section, and click Sheet configuration.
-
Optionally, check Duplex to enable content to be printed on the back of each sheet. Your printer must support duplex for this option to work. If Duplex is enabled, you can also check Tumble to duplex pages as in a calendar, and Facing pages to have the margins of the section switch alternately, so that pages are printed as if in a magazine or book.
-
If the option Same for all positions is checked, the same Media will be applied to every page in the print section. Uncheck this option.
-
Decide which Media should be linked to each sheet position: click the downward pointing arrow after Media and select a Media.
-
Optionally, decide which Master Page should be linked to each sheet; see Master Pages.
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.
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.
Dynamically switching the Media
In addition to applying Media to sheets via the settings, it is possible to change Media dynamically, based on a value in a data field, in a script. The script has already been made; you only have to change the name of the Media and the section in the script, and write the condition on which the Media has to be replaced.
-
On the Resources pane, expand the Contexts folder, expand the Print context, right-click the print section and click Sheet configuration.
-
Decide which pages should have dynamically switching media: every first page in the Print section, every last page, one of the pages in between (a 'middle page'), or a single page. (Uncheck the option Same for all positions, to see all page positions.)
-
In the area for the respective sheet position, click the Edit script button next to Media. The Script Wizard appears with a standard script:
results.attr("content","Media 1");
Media 1 will have been replaced with the name of the media selected for the chosen sheet position.
The field Selector in the Script Wizard contains the name of the section and the sheet position that you have chosen. -
Change the script so that on a certain condition, another media will be selected for the content. For instance:
if(record.fields.GENDER === 'M') {
results.attr("content","Media 2");
}This script changes the media to Media 2 for male customers.
See Writing your own scripts if you are not familiar with how scripts are written.
-
Click Apply, open the tab Preview and browse through the records to see if the script functions as expected.
-
When you click OK, the script will be added to the Scripts pane.
Rotating the Media in a Print section
The actual orientation of the Media and that of a section to which the Media is applied may not match.
The Media (to be more accurate: the Virtual Stationery images specified for this Media) can therefore be rotated per Print section:
- On the Resources pane, expand the Print context; right-click the Print section, and click Sheet configuration.
- Click one of the options next to Media rotation.
The Media will be rotated accordingly in the entire section.
Note:
- Any Virtual Stationery settings made for the Media also influence how the Media is displayed in each section (see Setting Media properties).
- Section backgrounds are rotated separately (see Using a PDF file or other image as background).
If in the Media properties, the Virtual Stationery position is set to Absolute, any offset given by the Top and Left values will be applied after rotation. A Virtual Stationery image located absolutely at the top left (Top: 0, Left: 0) will still appear at the top left of the page after rotating the Media.
Printing virtual stationery
Media are not printed, unless you want them to. Printing the virtual stationery is one of the settings in a Job Preset. To have the virtual stationery printed as part of the Print output:
-
Create a Job Preset that indicates that Media has to be printed: select File > Presets and see Output Presets for more details.
-
Select that Job Preset in the Print Wizard; see Generating Print output.