[reportlab-users] For Generating Multiple QR code o a pdf
Vaibhav Gajengi
vaibhav.gajengi at gmail.com
Fri Dec 20 00:06:19 EST 2013
Hello Tim,
Thanks for your reply.
Yes i tried with the renderPDF.draw(d,canvas,x,y).
but my problem is when i am calling the renderPDF.draw for each QRCode it
rendering the QRImage on different pages in PDF.
my requirement is that i want the qr images on a single page in PDF File.
Can i call the renderPDF.draw for multiple times ??
or is there is any other way to solve the above problem ??
please find attachment for PDF i want to place the qr code in rectangles
which i drawn in pdf but the QRCodes are getting drawn on different pages
in PDF File.
Thanks..
Best Regards
Vaibhav
On 20 December 2013 00:15, Tim Roberts <timr at probo.com> wrote:
> Vaibhav Gajengi wrote:
> >
> > Hello Vaibhav here,
> >
> > I want to generate the multiple QR Code on a single pdf file ??
> > Can anybody help me in this regards ?? some one posted on internet
> > this code snap
> >
> > qrw = QrCodeWidget('tokenitem')
> > print repr(qrw)
> > b = qrw.getBounds()
> > w=b[2]-b[0]
> > h=b[3]-b[1]
> > d = Drawing(100,100,transform=[110./w,0,0,110./h,0,0])
> > d.add(qrw)
>
> There's one more important step after this:
> renderPDF.draw( d, canvas, x, y )
>
> Did you actually try this? The QrCodeWidget generates a series of
> graphics.shapes.Groups. The graphics.shapes.Drawing object is a
> container for those shape Groups. The (100,100) is the size of the
> drawing surface in pixels, and the transform parameters make sure the QR
> code is scaled to fit into that size. Then, the renderPDF.draw line
> places that drawing on the canvas, at the (x,y) location in the
> renderPDF.draw call.
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20131220/65f691b8/attachment.htm>
More information about the reportlab-users
mailing list