Le 7 oct. 2014 à 13:54, J.F. Rick a écrit :

> Well, the QRCode natively just has a bitmap form. The little server app 
> requests that form (perhaps with a border, mirrored, reversed, etc.) and then 
> magnifies it and converts it to a PNG. So, putting the result in a PDF is as 
> trivial or as hard as putting a bitmap form into a PDF. How difficult that is 
> is something that Olivier can perhaps answer.

In fact, the faster approach is to convert the PNG to a JPEG picture with Pharo 
and to include it into a PDF Document with Artefact. It's easy to do but I 
can't estimate the quality lost of the picture (I suppose that's is important 
for the scanning of the QRCode with a phone).

pharoByExampleLogo := (ZnClient new
        url: 'http://pharobyexample.org/pictures/pbe-title.jpg';
        get).
aPage := PDFPage new.
aPage add: (PDFJpegElement from: 5 mm@0mm wh: 160mm@90mm fromStream: 
pharoByExampleLogo readStream).

The best solution is to create a QRCodeComponent in Artefact and draw the 
QRCode directly in the PDF document.  

Olivier ;-)


Reply via email to