syncfusion / flutter-examples

This repository contains the Syncfusion Flutter UI widgets examples and the guide to use them.
Other
1.98k stars 775 forks source link

Insert a Qr Code #576

Closed mouradkherouf closed 2 years ago

mouradkherouf commented 2 years ago

Hey,

I'd like to insert a Qr Code in a defined position of an existing page in a pdf file.

Is it possible with your library ?

Thanks

Surya-3013 commented 2 years ago

Hi @mouradkherouf ,

We recommend you draw the QR code image with the specific bounds: Rect.fromLTWH(left, top, width, height) in the PdfDocument. Kindly refer to the following code snippet for more details,

//Draw the image 
page.graphics.drawImage( PdfBitmap(File('image.jpg').readAsBytesSync()), Rect.fromLTWH( 0, 0, page.getClientSize().width, page.getClientSize().height));

Note: Rect.fromLTWH(left, top, width, height), Here left represents x-axis position and top represents y-axis position in the PDF document and width, height represents to set the draw image width and height.

Refer to the following articles for more details, https://help.syncfusion.com/flutter/pdf/working-with-images https://www.syncfusion.com/kb/11965/how-to-convert-image-to-pdf-in-syncfusion-flutter-pdf-library

Regards, Surya V