Label printing
Overview
The Metadata Exporter optional plug-in is available for the FileHold Desktop Application (FDA) for exporting metadata and system information from the document grid. The export format is flexible and based on a template that allows a variety of file formats to be created. One possible scenario is to generate the commands needed to print a label on a dedicated label printer.
Labels printed in this way have a couple of benefits.
- There is less chance of human error as the data on the label comes directly from FileHold,
- You can include a barcode on the label that can be scanned to quickly find the record in FileHold that matches the value in the barcode.
There are many manufacturers of dedicated label printers, but Zebra Technologies Corp. is one of the oldest with one of the widest range of printers for commercial use. FileHold Systems Inc. does not endorse any specific manufacturer of label printers, but this document will describe producing labels on a typical Zebra desktop printer.
Refer to the metadata exporter tool page for details on how to install and configure the metadata exporter. These instructions provide details to configure a scenario for printing labels on a dedicated label printer. A common application for these labels is in managing different types of controlled physical materials. These could be reference materials used for engineering tests or physical documents that cannot or will not be converted to electronic records. Of course, the labels could be used in any application that need metadata on a label.
Dedicated label printers are not the only option for printing labels with the output of the Metadata Exporter. Labelling software is available from companies like TAB Products with TABQUIK, Seagull Scientific with BarTender and many others, that can accept the files created by the Metadata Exporter to produce labels inkjet and laser printers.
For the remainder of this article, we will assume you have installed the Metadata Exporter.
Preparing the label
The Metadata Exporter works by sending the metadata and system information from the currently selected documents to a file by merging the values with a template file. The template defines which information will be exported and how it will be placed in the file. The Zebra label printer uses a simple text-based language called ZPL whose commands can be included in the template file.
To create the template file, we will first design our label. If you are an expert with ZPL, you could do this by hand, but it will likely be easier to use a GUI design tool. Many are available, but there is a free one from Zebra that can output the ZPL commands to a text file. The following example might be used for a physical file in the “Council Agenda” records series of the TOMRMS records classification system.
With the label designed, choose the print option to save to a file.
Preparing the printer
Now that we have something to print, we can set up and test the printer. The first step is simply to install the print driver provided by Zebra. This will let Windows know that the printer exists. We will not use this print driver directly but will instead be sending our ZPL file directly to the printer without processing it through the driver. This assumes the print driver will allow generic text to be passthrough without modification. You may need to install a generic text printer driver if the manufacturer’s default driver does not allow this.
With the driver in place, we can print to it with the old-school PRINT command. The first step is to share the printer from the printer properties. It will not actually be shared with other workstations, so things like permissions are not relevant.
Now we can open a command Window and enter the following command.
print d:\\<computer-name>\<share-name> test.prn
This assumes the file you created in the step above generated the text file test.prn. Replace the computer name and share name with the actual values from your system.
This should print a label verifying that are ready for the last step: the plug-in and template configuration.
Preparing the plug-in configuration
The plug-in XML file is described on the Metadata Exporter Tool page. We only need to add some details to enable printing. Set the <PlugInName/> to “Print label” or something relevant to your label printing. Set the <TemplateFile> location and name for the merge template. We will be writing a temporary file before printing, so give it a location and name. For simple printing <WaitForDeletion/> and <AppendDateAndTime/> can be false.
<?xml version="1.0" standalone="yes"?>
<ExportMetadataConfiguration>
<PlugInName>Print label</PlugInName>
<TemplateFile>
<TemplatePath>c:\Labels\label-template.prn</TemplatePath>
<TagStartCharacters>[*</TagStartCharacters>
<TagEndCharacters>*]</TagEndCharacters>
</TemplateFile>
<OutputFile>
<FilePath>c:\Labels</FilePath>
<Filename>label.prn</Filename>
<SeparatorBetweenFieldValues>-</SeparatorBetweenFieldValues>
<WaitForDeletion>false</WaitForDeletion>
<AppendDateAndTime>false</AppendDateAndTime>
<DateTimeFormatForFileName>yyyyMMddHHmmss</DateTimeFormatForFileName>
<PostProcessCommand>print /d:\\myworkstation\zebra c:\Labels\label.prn</PostProcessCommand>
</OutputFile>
<SystemFieldNames>
<Version>Version</Version>
<DocumentControlNumber>DocumentControlNumber</DocumentControlNumber>
<VersionControlNumber>VersionControlNumber</VersionControlNumber>
<ApprovalStatus>ApprovalStatus</ApprovalStatus>
<Owner>Owner</Owner>
<OutputFilename>OutputFilename</OutputFilename>
<DocumentId>FileHoldId</DocumentId>
<DocumentSchemaId>DocumentSchemaId</DocumentSchemaId>
<DocumentName>DocumentName</DocumentName>
<NoMatchingField> $$$ no matching field $$$ </NoMatchingField>
</SystemFieldNames>
</ExportMetadataConfiguration>
Preparing the template file
You will need a text editor for this next task. This description is specific for the Zebra printer and ZPL language, but similar little text languages are used for most similar label printers. We will start by loading the test.prn label file created above into a text editor. It will look something like this and I have highlighted the data portion of this label.
^XA^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ
^XA
^MMT
^PW812
^LL0406
^LS0
^FT792,352^A0I,34,33^FH\^FDC03 - Council Agenda^FS
^FT792,316^A0I,28,28^FH\^FD2022 Council Agendas^FS
^FT103,347^A0I,39,38^FH\^FD2022^FS
^FT761,35^A0I,34,33^FH\^FDFile ID # 142854.1^FS
^BY3,3,176^FT761,89^B3I,N,,N,N
^FD142854^FS
^PQ1,0,1,Y^XZ
In this step we will replace the data that was entered into the design program with replacement tags that will be a placeholder for the metadata and system fields we want on our labels. The file below is the same as the one above with the following replacement tags added:
- DocumentSchema – The name of the document schema.
- DocumentName – Simply the name of the document.
- FileHoldId – The internal document ID. This is unique for every document that will ever be added to FileHold.
- Version – The FileHold version number.
- Date – A metadata field. The date will be shown on the label using the format defined in the field.
Each of these replacement tag names are surrounded by [* *] as these are the tag start and end characters we defined in the configuration file.
^XA^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ
^XA
^MMT
^PW812
^LL0406
^LS0
^FT792,352^A0I,34,33^FH\^FD[*DocumentSchema*]^FS
^FT792,316^A0I,28,28^FH\^FD[*DocumentName*]^FS
^FT103,347^A0I,39,38^FH\^FD[*Date*]^FS
^FT761,35^A0I,34,33^FH\^FDFile ID # [*FileHoldId*].[*Version*]^FS
^BY3,3,176^FT761,89^B3I,N,,N,N
^FD[*FileHoldId*]^FS
^PQ1,0,1,Y^XZ
Note that the FileHoldId is used twice. Once will be on the label in human readable text and the other will be the barcode.
Save the template file with using a naming matching that defined in the configuration file and the set up is complete. Simply select one or more documents, right click, select Send then choose the menu option for the plug-in defined in the configuration file to send the labels to the printer. The plug-in will first create or overwrite the file then execute the PRINT command defined in the post processing.
Scanning the label
When there is a barcode added to the label, there is an option to scan it to quickly find the document in the system. The best way to do this is with a quick search defined to search for whatever value is encoded in the barcode. In this case it is the document ID which is one of the search options available from the advanced search panel Special Fields > FileHold ID. Barcode scanners that can pretend to be a keyboard are readily available. You will want to configure the scanner to send the enter key after the barcode to start the search immediately.