[reportlab-users] Performance Issue generating multiple QR codes

Tim Roberts timr at probo.com
Wed Sep 17 13:43:30 EDT 2014


Thomas Kremmel wrote:
> Hello,
>
> I'm using Reportlab to generate a pdf with 10 pages. I print on each
> page a QR code, which is about half the size of the A4 page.

Seriously?  You have a QR block that covers 40 square inches?  Will QR
scanners read that?


> The generation of the .pdf takes me about 20 seconds.
> When I generate the .pdf without the QR codes the .pdf is generated
> immediately. Thus it is obvious that the pdf generation of the QR
> codes consumes the most time.
>
> Any idea what I could do here to bring this down to an user acceptable
> time - say 2 seconds.

Generating a QR code is computationally expensive.  There's no two ways
about it.  It's a recursive algorithm with lots of mathematics.  If this
is a problem for you, you could try to rewrite part of the algorithm in
C++, but it would be tricky to integrate that with the Python code.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list