private void printDocument_PrintPage(object sender, PrintPageEventArgs e)
{
//e.Graphics.DrawRectangle(Pens.Red, new Rectangle (e.MarginBounds.X, e.MarginBounds.Y, e.MarginBounds.Width, e.MarginBounds.Height));
//Info width = 827
//Info height = 1169
float top = e.MarginBounds.Top;
float bot = e.MarginBounds.Top;
for (; _codecount < Files.Count; _codecount++)
{
if (bot > e.MarginBounds.Bottom)
{
e.HasMorePages = true;
return;
}
var info = new FileInfo(Files[_codecount].Text);
var text = info.Name.Substring(0, info.Name.Length - info.Extension.Length);
float height;
PrintCodeImageText(e, text, ref top, out bot, 32, out height);
bot = top + height;
}
e.HasMorePages = false;
}