Exemplo n.º 1
0
        ///// <summary>
        ///// 无作为的初始化对象
        ///// </summary>
        //public PrintPage()
        //{
        //}

        public PrintPage(
            IPageDocument document,
            XPageSettings pageSettings,
            PrintPageCollection pages,
            int headerHeight,
            int footerHeight)
        {
            myDocument      = document;
            myPageSettings  = pageSettings;
            myOwnerPages    = pages;
            intHeaderHeight = headerHeight;
            intFooterHeight = footerHeight;
            intWidth        = (int)myPageSettings.ViewClientWidth;
            // 对标准页高缩小点,避免由于某个页高正好等于标准页高时该页最下面
            // 的线条无法显示和打印。(通融才能从容)
            intHeight = this.ViewStandardHeight - 10;
        }
Exemplo n.º 2
0
 /// <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));
 }
Exemplo n.º 3
0
 /// <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);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 初始化对象
 /// </summary>
 /// <param name="doc">文档对象</param>
 /// <param name="pages">页面集合</param>
 public PageContentDrawer(IPageDocument doc, PrintPageCollection pages)
 {
     this.myDocument = doc;
     this.myPages    = pages;
 }
Exemplo n.º 5
0
 public void AddRange(PrintPageCollection pages)
 {
     this.InnerList.AddRange(pages);
 }