[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 Mon, 2024-03-11 at 11:58 +0100, Florent Rougon wrote:
> Hi,
> 
> I haven't read the whole thread (sorry) but thought this might help.
> 
> hw <hw@adminart.net> wrote:
> 
> > When I zoom in on QR-codes in a PDF viewer, they don't get blurry.
> > Perhaps the pst-barcode package uses vector graphics?
> 
> That is quite likely: the pst- prefix means this is PSTricks, which is
> an oldish way of doing vector graphics with LaTeX. I tend to avoid
> PSTricks these days as it is generally awkward to use in PDF contexts,
> although there are various workarounds that often allow to do so.

Is that bad?  It works great for what I'm doing.

> The ubiquitous, powerful and modern way to do vector graphics in LaTeX
> is PGF/TiKZ[1],

That package has almost 1300 pages of documentation which doesn't seem
to mention qr-codes or barcodes.

> however this is not even necessary for QR codes, because
> [...]

good :)

> I've played with a different package for producing QR codes in LaTeX,
> which uses the aforementioned \hrule and \vrule primitives: qrcode. Its
> manual is here (follow the “Package documentation” link):
> 
>   https://ctan.org/pkg/qrcode

I wonder why it uses different options for URLs and other data.  What
difference does that make?

> Here is a simple example you can compile with pdflatex:
> 
> \documentclass{article}
> \usepackage{qrcode}
> 
> \pagestyle{empty}
> 
> \begin{document}
> 
> \noindent
> % \qrset affects \qrcode commands in the current group. You can use it
> % to factor out options used for several QR codes.
> \qrset{nolinks, padding}% add padding to make sure the codes are “legal”/readable
> \qrcode[version=1]{Hey Debian-user!}% Can't do version=1 with level=M or more
> \qrcode[level=L, version=1]{Hey Debian-user!}% Less redundancy but is doable
> 
> \end{document}
> 
> Note the terminal output:
> 
> ------------------------------------------------------------------------
> <QR code requested for "Hey Debian-user!" in version 1-M.>
> <Requested QR version '1' is too small for desired text.
> Version increased to '2' to fit text.>
> <Error-correction level increased from M to Q at no cost.>
> 
> <Copying the QR code for "Hey Debian-user!" in version 2-Q as previously calculated.>
> 
> 
> <QR code requested for "Hey Debian-user!" in version 1-L.>
> 
> <Copying the QR code for "Hey Debian-user!" in version 1-L as previously calculated.>
> ------------------------------------------------------------------------

It might be worth a try for when I need to experiment with qr-codes on
small labels again.  It might not work because I may need to place the
qr-code in some way and it could conflict with other packages like the
labels package ...  I even might have already tried it; it's been a
few years and I don't remember exactly.

> [...]
> But with low printer resolution constraints, who knows?).
> 
> Hope this helps!

Yes, thanks, knowing about these packages can be useful.

Now I'm wondering why the qr-codes I printed with the label printer
couldn't be reliably scanned.  When I look at [1] and [2], for the
data I wanted to print (between 38 and 40 alphanumericals at L
quality) I would have to use a version 2 qr code, i. e. 25x25 modules.
I don't know how the modules transfer to dots, but assuming the
minimum of 4 dots per module, it would take 25 x 4 dots, i. e. 100
dots.  Each module would be 0.33mm in size which would require 25 x
0.33mm, i. e. 8.25mm for the size of the qr-code.

I printed the qr-code much larger than that, about 1x1".  That is
about three times as large as would be required, and the printer can
print three times as many dots per inch as the 100 dots needed.

So in theory, my theory that the resolution of the printer is too low
can't be true.

But why couldn't these qr-codes be scanned?  It shouldn't have been a
problem at all.


[1]: https://www.qrcode.com/en/about/version.html
[2]: https://www.qrcode.com/en/howto/cell.html

> 
> Regards
> 
> [1] https://ctan.org/pkg/pgf
> 



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


Reply to: