Ejemplo n.º 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);
                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;
        }
Ejemplo n.º 2
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);
				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;
		}