
This article appeared in the Kenai National Wildlife Refuge’s Refuge Notebook series on April 13, 2018.

This article appeared in the Kenai National Wildlife Refuge’s Refuge Notebook series on April 13, 2018.
I wanted to be able to print small QR codes readable by our Motorla DS6708 scanner directly onto laser-printed insect specimen labels to use with Arctos‘ object tracking system, preferably using free software. In case this would be useful to anyone else, this post describes my methods.
All of the files mentioned below, including pdf output, are available in a zipped archive here. Note that most or all of the links to Arctos pages included below will not work for anyone who is not an Arctos operator having the appropriate roles.
A comma-separated list can easily be made using MS Excel, a text editor, etc. Today I have a list of 330 specimen catalog numbers (most omitted):
1436, 1534, … 10175, 10176
My last container label/barcode was KNWRC1225, so today I will be starting with KNWRC1226.
I submit the query below to Arctos via Reports > Write SQL, selecting the CSV format for the result set.
select * from flat where cat_num in ( 1436, 1534, … 10175, 10176 ) and COLLECTION = 'KNWR ENTO'
I download the CSV to the folder in which I want to make the labels and rename it something like 2013-03-08-1012_label_data.csv.
Below is the script controlling the generation of the labels.
working.directory <- "J:/mattbowser/labels"
setwd(working.directory)
input.file <- "2013-03-08-1012_label_data.csv"
options(encoding="UTF-8")
source("f_makelabels_2013-03-08-1053.R")
make.labels(
working.directory=working.directory,
input.file=input.file,
type="pin",
barcode.start=1226, prefix="KNWRC"
)
Running this script in R generates the labels, but a lot goes on behind the scenes, requiring some free software.
The script above calls the function make.labels defined in the text file f_makelabels_2013-03-08-1053.R. This can take a while.
make.labels calls the function make.qrcodes defined in the file f_makeqrcodes_2012-09-26-1348.R to make the QR codes. Since I lack authorization to install programs on my workplace computer, the function needs the locations of the executables (qrcode, ImageMagick, and potrace).
The script writes a TeX file, 2013-03-08-1012_label_data.tex, based on the input data. It then runs this TeX file through XeLaTeX, generating the labels in pdf format. The TeX file calls for two customized TrueType fonts to make these labels, DroidSansDotted90.ttf and DroidSansDotted-Bold90.ttf.
Command line output:
[1] "working directory: J:/mattbowser/labels" [1] "input: 2013-03-08-1012_label_data.csv" [1] "label type: pin" [1] "barcode series: KNWRC1226-KNWRC1555" [1] "output TeX file: 2013-03-08-1012_label_data.tex" [1] "command: xelatex 2013-03-08-1012_label_data.tex"
The labels can now be printed.
Check over the labels carefully before proceeding. If they are satisfactory, the labels can now be put onto the pins.
A container series matching that of the pdf needs to be made in Arctos via Manage Data > Object Tracking > Create Container Series. The main R script spits out the start and stop label/barcode values on the command line for this purpose.
make.labels generates a file for this purpose, 2013-03-08-1012_label_data_upload.csv. Upload this file via Enter Data > Batch Tools > Parts>>Containers. Now these pins can be scanned into their parent containers…