[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: printing QR-codes on labels with 300dpi label printers with LaTeX



On Sat, 2024-03-09 at 23:20 +0700, Max Nikulin wrote:
> On 09/03/2024 19:08, hw wrote:
> > On Fri, 2024-03-08 at 23:21 +0700, Max Nikulin wrote:
> > > On 08/03/2024 12:35, hw wrote:
> > > > On Thu, 2024-03-07 at 23:15 -0500, Jeffrey Walton wrote:
> > > > > 
> > > > > I have a USB thermal printer for the shipping labels,
> > > > > <https://www.amazon.com/gp/product/B08V28J3JS>.
> > > > 
> > > > This printer has only 300dpi.  If you print QR-codes on it make sure
> > > > you can scan them: they have to be large enough or get you an
> > > > unscanable smear.
> > > 
> > > I believed that 300dpi is high enough resolution for QR-codes of
> > > reasonable size if source image has proper quality. On the other hand,
> > > if possible, it is better to scale QR-codes to match some whole factor
> > > of printer pixel size.
> > 
> > What do you consider a 'reasonable size'?
> 
> Looking at a QR code likely having ~75 pixels per inch I find it 
> unreasonably small for delivery labels.

Shipping labels tend to be pretty large.

> I am in doubts if its redundancy is high enough to reliably
> recognize it if it would be scratched during delivery. Another

Increased redundancy can make the QR-code harder or impossible to
scan because it creates more smear instead of more redundancy.

Once you've seen what that looks like, it is evident that smearing
more ink into the same area for more redundancy makes things only
worse.  You'd have to print the QR-code larger.

> limitation may be stability of optics in scanners in respect to
> labels. This one is printed using a laser printer with resolution at
> least 600 dpi. Each QR code pixel has still 4x4 printer dots in the
> case of 300dpi, so when image is properly aligned, printer quality
> is not an issue.

Yes, the QR-codes printed on a 600dpi laser printer are fine.

> > There is no source image other than whatever LaTeX creates.  I can
> > specify the size of the QR-code.  Other than that, how do you apply
> > scaling?
> 
> I am unsure what particular QR code generator do you use and what is the 

I'm using the pst-barcode package and pdflatex to create a PDF file
which is then sent through cups to the printer.  So LaTeX, the
bst-barcode package, some PDF stuff, the printer driver, the printer
and it's settings for darkness and printing speed, the material the
labels are made of and the ribbon with the ink on it which gets
transferred to the label all influence the result.

Also, labels are continuously being fed through the printer while
printing without stopping.  That makes some smear inevitable.

> format of QR codes.

It basically goes like this:

\psbarcode{textblah foo}{height=0.6 width=0.6 eclevel=L}{qrcode}

That works for 600dpi laser printers.  When you print the QR-code with
a 300dpi label printer you can't reliably scan it, not even when you
make the QR-code 1x1" in size.

Perhaps that's not a reasonable size?

> Is it raster or vector image? Specify size that makes QR code pixels
> having whole number of printer pixels.

I only know that the QR-code must fit on the label.

> "Fit to page" or "fit to printable area" in printer options may make an 
> image blurry.

No such options are specified.

> In the case of low input image resolution, upscaling method suitable
> for photos may make QR code blurry. However consistent configuration
> should make QR codes sharp.

IIRC there is an option to create a PDF having a particular
resolution, like 300DPI, but that didn't seem to have any effect.  I
don't remember what that option was :/

The QR-codes are sharp and easily scanable when printed in 600dpi.
With the label printer you can't really tell if they're sharp or not.


Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: