[reportlab-users] Performance Issue generating multiple QR codes
thomasspin at gmail.com
Wed Sep 17 07:53:10 EDT 2014
additional info: the creation time is directly related to the length of the
input string to the qr code. the data for my qr code is very long and the
resulting qr code quite complex.. the length of the input data is 229. if i
input a text with 10 characters it is very fast.
thus it seems as it needs quite a lot computing power to draw this kind of
complex qr code..
2014-09-17 13:38 GMT+02:00 Thomas Kremmel <thomasspin at gmail.com>:
> 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.
> 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.
> Here are some source snippets to get an idea what I'm doing.
> import from reportlab.graphics.barcode.qr import QrCodeWidget
> def draw_qr_code(self):
> qr_code_data = get_qr_code_data("input text")
> qrw = QrCodeWidget(qr_code_data, barLevel='M')
> b = qrw.getBounds()
> d = Drawing(220, 220, transform=[220./w, 0, 0, 220./h, 115, 0])
> def drawing(self, drawing):
> def generate(self):
> # this consumes about 18 of the 20 seconds..
> Would be great if someone could shed some light on this topic.
> All the best,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the reportlab-users