示例#1
0
        public void RunPages(Pages pgs)         // this does all the work
        {
            foreach (Page p in pgs)
            {
                //Create a Page Dictionary representing a visible page
                page    = new PdfPage(anchor);
                content = new PdfContent(anchor);

                PdfPageSize pSize = new PdfPageSize((int)r.ReportDefinition.PageWidth.Points,
                                                    (int)r.ReportDefinition.PageHeight.Points);
                page.CreatePage(pageTree.objectNum, pSize);
                pageTree.AddPage(page.objectNum);

                //Create object that presents the elements in the page
                elements = new PdfElements(page, pSize);

                ProcessPage(pgs, p);

                // after a page
                content.SetStream(elements.EndElements());

                page.AddResource(fonts, content.objectNum);

                int size = 0;
                tw.Write(page.GetPageDict(filesize, out size), 0, size);
                filesize += size;

                tw.Write(content.GetContentDict(filesize, out size), 0, size);
                filesize += size;
            }
            return;
        }
示例#2
0
        // this does all the work
        public void RunPages(Pages pgs)
        {
            foreach (Page p in pgs)
            {
                //Create a Page Dictionary representing a visible page
                page=new PdfPage(anchor);
                content=new PdfContent(anchor);

                PdfPageSize pSize=new PdfPageSize((int) r.ReportDefinition.PageWidth.Points,
                                    (int) r.ReportDefinition.PageHeight.Points);
                page.CreatePage(pageTree.objectNum,pSize);
                pageTree.AddPage(page.objectNum);

                //Create object that presents the elements in the page
                elements=new PdfElements(page, pSize);

                ProcessPage(pgs, p);

                // after a page
                content.SetStream(elements.EndElements());

                page.AddResource(fonts,content.objectNum);
                page.AddResource(patterns,content.objectNum);
                //get the pattern colorspace...
                PatternObj po = new PatternObj(anchor);
                page.AddResource(po,content.objectNum);

                int size=0;
                tw.Write(page.GetPageDict(filesize,out size),0,size);
                filesize += size;

                tw.Write(content.GetContentDict(filesize,out size),0,size);
                filesize += size;

                tw.Write(po.GetPatternObj(filesize, out size),0,size);
                filesize += size;
            }
            return;
        }
示例#3
0
        public void RunPages(Pages pgs)	// this does all the work
        {
            foreach (Page p in pgs)
            {
                //Create a Page Dictionary representing a visible page
                page = new PdfPage(anchor);
                content = new PdfContent(anchor);

                PdfPageSize pSize = new PdfPageSize((int)r.ReportDefinition.PageWidth.ToPoints(),
                                    (int)r.ReportDefinition.PageHeight.ToPoints());
                _pSize = pSize;
                page.CreatePage(pageTree.objectNum, pSize);
                pageTree.AddPage(page.objectNum);
                if (r.ItextPDF)
                {
                    //Itextsharp pdf handler, set pagesize
                    pdfdocument.SetPageSize(new iTextSharp.text.Rectangle(r.ReportDefinition.PageWidth.ToPoints(), r.ReportDefinition.PageHeight.ToPoints()));
                    pdfdocument.NewPage();
                }
                //Create object that presents the elements in the page
                elements = new PdfElements(page, pSize);

                ProcessPage(pgs, p);

                // after a page
                content.SetStream(elements.EndElements());

                page.AddResource(fonts, content.objectNum);
                page.AddResource(patterns, content.objectNum);
                //get the pattern colorspace...
                PatternObj po = new PatternObj(anchor);
                page.AddResource(po, content.objectNum);
                if (r.ItextPDF == false)
                {
                    int size = 0;
                    tw.Write(page.GetPageDict(filesize, out size), 0, size);
                    filesize += size;

                    tw.Write(content.GetContentDict(filesize, out size), 0, size);
                    filesize += size;

                    tw.Write(po.GetPatternObj(filesize, out size), 0, size);
                    filesize += size;
                }
            }
            return;
        }