I'm trying to print multiple QR images in 1 page, but when i print i receive the last image only, the Code is:
int QRLoop = Convert.ToInt32(txtSerialTo.Text) - Convert.ToInt32(txtSerialFrom.Text) + 1;
for (int i = 0; i < QRLoop; i++)
{
int iSerial = Convert.ToInt32(txtSerialFrom.Text) + i;
string QRString = iSerial.ToString() + "," + dtpDate.Value.ToShortDateString() + "," + JobNr + "," + Batch + "," + LineNr + "," + Model;
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(QRString, QRCodeGenerator.ECCLevel.L, false, false, QRCodeGenerator.EciMode.Default, -1);
QRCode qrCode = new QRCode(qrCodeData);
Bitmap qrCodeImage = qrCode.GetGraphic(1);
pbx[i].Image = qrCode.GetGraphic(1);
}
xx = 30;
yy = 0;
int x = 0;
for(int h = 0; h < QRLoop - 1; h++)
{
p.PrintPage += delegate (object sender1, PrintPageEventArgs e1)
{
e1.Graphics.DrawImage(pbx[h].Image, xx, yy);
e1.Graphics.DrawString((h + 1).ToString(), new System.Drawing.Font("Arial", 9, FontStyle.Bold), new SolidBrush(Color.Black), new RectangleF(xx + 45, yy + 5, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
};
xx += 91;
x++;
if (x == 4)
{
x = 0;
xx = 30;
yy += 47;
}
}
p.Print();
Any help?