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;
        }
Exemple #2
0
 public PdfElements(PdfPage pg, PdfPageSize pageSize)
 {
     p        = pg;
     pSize    = pageSize;
     elements = new StringBuilder();
 }
		/// <summary>
		/// Create The Pdf page
		/// </summary>
		public void CreatePage(int refParent,PdfPageSize pSize)
		{
			pageSize=string.Format("[0 0 {0} {1}]",pSize.xWidth,pSize.yHeight);
			page=string.Format("\r\n{0} 0 obj<</Type /Page/Parent {1} 0 R/Rotate 0/MediaBox {2}/CropBox {2}",
				this.objectNum,refParent,pageSize);
		}
		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;
		}
Exemple #5
0
 /// <summary>
 /// Create The Pdf page
 /// </summary>
 public void CreatePage(int refParent, PdfPageSize pSize)
 {
     pageSize = string.Format("[0 0 {0} {1}]", pSize.xWidth, pSize.yHeight);
     page     = string.Format("\r\n{0} 0 obj<</Type /Page/Parent {1} 0 R/Rotate 0/MediaBox {2}/CropBox {2}",
                              this.objectNum, refParent, pageSize);
 }
		public PdfElements(PdfPage pg, PdfPageSize pageSize)
		{
			p = pg;
			pSize=pageSize;
			elements = new StringBuilder();
		}