Adding Header and Trailer Pages to Output Created with DocBridge Mill: cpmcopy
In combination with "page templates" the DocBridge Mill: cpmcopy parameter "xifvariables" is used to add additional text to the output. The following simple steps explain how to create the template containing "xif variables" and subsequently substitute these with the DocBridge Mill: cpmopy command.
Page Template:
1. Create a template page in a licensed input document format

2. Convert the page to the DocBridge Mill file format XIF
cpmcopy –i <inputfile name> -type <file type> -o –type XIF
3. Open the XIF file in a text editor
4. Find the text item(s) to be replaced with the XIF variables, in our example"StatementSample.txt"
5. Replace the dummy text fields with the DocBridge Mill XIF Variable fields
Replace the text "StatementSample.txt" with "<cp:field value="filename" />" :
<text font='1'>File name: StatementSample.txt</text>
becomes
<text font='1'>File name: <cp:field value="filename" /></text>
6. In addition, XIF fields to automatically set the runtime date and time can be added.
1. Replace the text "Dummy date field" with "<cp:field value="date()" dateformat="dddd, d. MMMM yyyy"/>" :
<text font='1'>Date: Dummy date field</text>
becomes
<text font='1'>Date: <cp:field value="date()" dateformat="dddd, d. MMMM yyyy"/></text>
2. Replace the text "Dummy date field" with "<cp:field value="time()" timeformat="HH:mm:ss"/>" :
<text font='1'>Time: Dummy time field</text>
becomes
<text font='1'> Time: <cp:field value="time()" timeformat="HH:mm:ss"/></text>
7. Save the file.
Note: pay attention to include/ keep all special characters of the JavaScript syntax.
DocBridge Mill: cpmcopy command line:
The XIF variables can now be populated by specifying the template file as an additional input file and defining the variables and their values in the DocBridge Mill: cpmcopy command call:
cpmcopy – -i[infile] <template file name> -xifvariables filename=<input file name> -infile <input file name> -o[outfile] <output file name>
Note: The date and time fields are automatically populated by DocBridge Mill.
The first page in the output file is the template page:



