/// <summary> /// 创建文档指定页的位图 /// </summary> /// <param name="doc">文档对象</param> /// <param name="pages">页面集合</param> /// <param name="PageIndex">指定页的序号</param> /// <param name="DrawBorder">是否绘制页面边框</param> /// <returns>生成的BMP位图文档对象</returns> public static byte[] GetPageMetafile( IPageDocument doc, PrintPageCollection pages, int PageIndex, bool DrawBorder, PageContentDrawer drawer) { drawer.Document = doc; drawer.Pages = pages; drawer.BackColor = System.Drawing.Color.White; if (DrawBorder) { drawer.BorderColor = System.Drawing.Color.Black; } else { drawer.BorderColor = System.Drawing.Color.Transparent; } return(drawer.GetMetafile(pages[PageIndex], true)); }
/// <summary> /// 创建文档指定页的位图 /// </summary> /// <param name="doc">文档对象</param> /// <param name="pages">页面集合</param> /// <param name="PageIndex">指定页的序号</param> /// <param name="DrawBorder">是否绘制页面边框</param> /// <returns>生成的BMP位图文档对象</returns> public static System.Drawing.Bitmap GetPageBmp( IPageDocument doc, PrintPageCollection pages, int PageIndex, bool DrawBorder, PageContentDrawer drawer) { drawer.Document = doc; drawer.Pages = pages; drawer.BackColor = System.Drawing.Color.White; if (DrawBorder) { drawer.BorderColor = System.Drawing.Color.Black; } else { drawer.BorderColor = System.Drawing.Color.Transparent; } System.Drawing.Bitmap bmp = drawer.GetPageBmp(pages[PageIndex], true); return(bmp); }