Re: For Generating Multiple QR code o a pdf

Vaibhav Gajengi <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <CADaVOyW1LQ4gTVi_Dy6gPsWqPqtO3Ln0JvMQ8b_Bh_j+o2yoMw@mail.gmail.com>
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 <[email protected]> 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, [email protected]
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> reportlab-users mailing list
> [email protected]
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.