[cups] Auto-reformatting shipping labels for a 4x6 thermal printer

Jörg Thümmler listen at vordruckleitverlag.de
Sun Jun 18 23:23:57 PDT 2023


Am 18.06.23 um 23:59 schrieb Nick Bogdanov:
> I started doing small-scale e-commerce projects, and found that manually
> feeding US Letter (8.5x11) sticky labels through my old LaserJet 5L was a
> pain.  So I bought a surplus Zebra GK420d thermal label printer, plugged it
> into my network, and loaded it up with a spool of 4x6 shipping labels.  The
> Zebra printer speaks ZPL and works flawlessly with CUPS.  I have been very
> happy with it so far.
> 
> This arrangement is fairly painless when an online service (e.g. FedEx)
> provides a PDF with a label specifically formatted for 4x6 label printers.
> It's more of a hassle when they only want to provide PDFs sized for US
> Letter printers, with 2 labels per sheet (or 1 label per half sheet).  If
> you purchase bulk shipping labels from eBay, for instance, there is no
> option to request 4x6 labels; they just send you one giant PDF with 2
> labels per 8.5x11 page.  If you try to print this to the 4x6 Zebra printer,
> the labels get completely mangled; usually it gets cut off right in the
> middle.
> 
> The workarounds I found searching online involved manually importing each
> bulk label PDF into Adobe Acrobat and cropping it by hand.  This isn't a
> very scalable solution and there ought to be a way to make the software do
> the heavy lifting for us.
> 
> What I'd like to do is have CUPS notice that I'm printing an 8.5x11 sheet
> of labels to a 4x6 form factor printer, and automatically reformat each
> label on the page to fit the 4x6 media.  I would also like to have the
> ability to optionally resize it to fit on smaller 4x3 labels, which are
> more convenient for tiny packages.
> 
> What would be a good way to approach this?  I would be comfortable writing
> some code if needed.  I don't know the CUPS architecture at all, though,
> and I'm not sure where to start.
> 
> cc: Michael since he seems to be the main contributor
> to filter/rastertolabel.c
> _______________________________________________
> cups mailing list
> cups at cups.org
> https://lists.cups.org/mailman/listinfo/cups

Hi,

if you have Adobe Acrobat at hands, there is an "Action wizard", you can 
(if I understand that correctly) change multiple files at one time and 
seems you can save the workflow for multiple usage too. So you should be 
able to resize the label files.

Other possibility could be to use cups to print to a pdf printer where 
the page format is set to your label format and scaling is set to "fit 
page"... this could be done in a batch too a assume...

-- 
cu

jth



More information about the cups mailing list