C#
public void PD_PrintPage(object sender, PrintPageEventArgs e)
{
float W = e.MarginBounds.Width;
float H = e.MarginBounds.Height;
for (; FileCounter >= 0; FileCounter--)
{
try
{
Bitmap Bmp = new Bitmap(BmpFiles[FileCounter]);
if (Bmp.Width / W Bmp.Height / H)
W = Bmp.Width * H / Bmp.Height;
else
H = Bmp.Height * W / Bmp.Width;
e.Graphics.DrawImage(Bmp, 0, 0, W, H);
break;
}
catch
{
}
}
FileCounter -= 1;
if (FileCounter > 0)
{
e.HasMorePages = true;
}
else
{
FileCounter = BmpFiles.Length - 1;
}
}this will print all images in different page
I want some functionality that will print one image ,leave some space and again prine other image in same page if space is remaining.

Suthish NairRank #92 · 22.8K reputationPosted Sep 10, 2013, 4:16 AM EDT
Yarra Haz2 reputationPosted Oct 28, 2013, 3:33 AM EDT
What you should do is perform all your printing in one call. Your "for" loop is only going once because you break inside it after the first loop. You should change it to loop more than once and do the printing inside the loop. At the end, simply set HasMorePages to false because you don't need a second page.
Another approach is to stitch the two images in one large image, and then print this image. I know a third-party toolkit that supports different image processing functions including the ability to combine different images and print them. You can find details in the following page:
http://support.leadtools.com/CS/forums/40654/ShowPost.aspx