Shipping labels, the Linux-way

We have started using shipping labels on most of our international parcels, instead of plastic pouches. This is a small step towards making less plastic garbage; not our first and not our last one. Customs documentation can be made online, so to most destinations, plastic pouches provided by FedEx can be replaced with a small sticker. As usual, we are not searching for the easiest way (buying a ZPL label printer), but the Linux-way.

We will print them to A4 adhesive sheets, four on one page. To achieve this, we convert the A4 shipping list to small, A6-sized stickers with the following bash script:

#!/bin/bash
cd ./labels/
for FILE in *.pdf; do
  pdfcrop --margins '30 -420 -70 30' "${FILE}" cropped-"${FILE}"
done
filelist=`ls cropped-*.pdf`
pdfjam --nup 2x2,landscape $filelist --outfile ../output.pdf
rm cropped-*.pdf

We use the pdfcrop and pdfjam utilities. They are available in the texlive-extra-utils Debian package. In the first step, we cut out the unnecessary parts. In the second, we make an A4-sized sheet with four labels, which is ready to print with a normal laser printer.
Linux is not only on our t-shirts but under the hood too.

Gábor KumGábor Kum
founder of HELLOTUX

 

Be the first who leaves a comment!

Leave a comment!

Your name:

Your e-mail (kept private and will not be shown):

Comment:

Please type the word smile here: