public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e)
        {
            Image image = new Bitmap(e.PageSettings.PaperSize.Width, e.PageSettings.PaperSize.Height);

            PreviewPageInfo info = new PreviewPageInfo(image, new Size(e.PageSettings.PaperSize.Width,
                                                                       e.PageSettings.PaperSize.Height));

            pageInfoList.Add(info);

            Graphics g = Graphics.FromImage(info.Image);

            g.FillRectangle(new SolidBrush(Color.White), new Rectangle(new Point(0, 0), new Size(image.Width, image.Height)));

            return(g);
        }
 public PreviewPageInfo [] GetPreviewPageInfo()
 {
     PreviewPageInfo [] pi = new PreviewPageInfo[pageInfoList.Count];
     pageInfoList.CopyTo(pi);
     return(pi);
 }