public PdfContent(PdfAnchor pa) : base(pa)
        {
            CanCompress = pa.CanCompress;
            content     = null;
//			contentStream="%stream\r";
            contentStream = "";
        }
		public PdfContent(PdfAnchor pa):base(pa)
		{
			CanCompress = pa.CanCompress;
			content=null;
//			contentStream="%stream\r";
			contentStream="";
		}
示例#3
0
        float _y;               // y location on page

        /// <summary>
        /// Create the image Dictionary
        /// </summary>
        public PdfOutlineEntry(PdfAnchor pa, int p, string text, float x, float y) : base(pa)
        {
            _p    = p;
            _x    = x;
            _y    = y;
            _text = text;
        }
		public PdfCatalog(PdfAnchor pa, string l):base(pa)
		{
			if (l != null)
				lang = String.Format("/Lang({0})", l);
			else
				lang = "";
		}
示例#5
0
 /// <summary>
 /// Create the font Dictionary
 /// </summary>
 public PdfFontEntry(PdfAnchor pa, string fontName, string fontFace) : base(pa)
 {
     font     = fontName;
     fontDict = string.Format("\r\n{0} 0 obj<</Type/Font/Name /{1}/BaseFont/{2}/Subtype/Type1/Encoding /WinAnsiEncoding>>\tendobj\t",
                              this.objectNum, fontName, fontFace);
     //fontDict = string.Format("\r\n{0} 0 obj<</Type/Font/Name /{1}/BaseFont/{2}/Subtype/Type1>>\tendobj\t",
     //    this.objectNum, fontName, fontFace);
 }
        /// <summary>
        /// Create the image Dictionary
        /// </summary>
        public PdfImageEntry(PdfAnchor pa, PdfPage p, int contentRef, string nm, ImageFormat imgf, byte[] im, int width, int height) : base(pa)
        {
            name = nm;
            imf  = imgf;
            ba   = im;

            string filter;
            string colorSpace;

            if (imf == ImageFormat.Jpeg)
            {
                filter = "/DCTDecode";

                switch (JpgParser.GetColorSpace(ref im))
                {
                case 0:
                    colorSpace = "/DeviceRGB";
                    break;

                case 1:
                    colorSpace = "/DeviceGray";
                    break;

                case 3:
                    colorSpace = "/DeviceRGB";
                    break;

                case 4:
                    colorSpace = "/DeviceCMYK";
                    break;

                default:
                    colorSpace = "/DeviceRGB";
                    break;
                }
            }
            else if (imf == ImageFormat.Png)    // TODO: this still doesn't work
            {
                filter     = "/FlateDecode /DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 8 /Columns 80>>";
                colorSpace = "/DeviceRGB";
            }
            else if (imf == ImageFormat.Gif)    // TODO: this still doesn't work
            {
                filter     = "/LZWDecode";
                colorSpace = "/DeviceRGB";
            }
            else
            {
                filter     = "";
                colorSpace = "";
            }
            imgDict = string.Format("\r\n{0} 0 obj<</Type/XObject/Subtype /Image /Width {1} /Height {2} /ColorSpace {5} /BitsPerComponent 8 /Length {3} /Filter {4} >>\nstream\n",
                                    this.objectNum, width, height, ba.Length, filter, colorSpace);

            p.AddResource(this, contentRef);
        }
示例#7
0
 public PdfCatalog(PdfAnchor pa, string l) : base(pa)
 {
     if (l != null)
     {
         lang = String.Format("/Lang({0})", l);
     }
     else
     {
         lang = "";
     }
 }
示例#8
0
        /// <summary>
        /// Create the font Dictionary
        /// </summary>
        public PdfPatternEntry(PdfAnchor pa, String patternName, String patternType) : base(pa)
        {
            pattern = patternName;
            switch (patternType)
            {
            case "BackwardDiagonal":
                patternDict = BackwardDiagonal();
                break;

            case "DarkDownwardDiagonal":
                patternDict = DarkDownwardDiagonal();
                break;

            case "DarkHorizontal":
                patternDict = DarkHorizontal();
                break;

            case "Vertical":
                patternDict = Vertical();
                break;

            case "OutlinedDiamond":
                patternDict = OutlinedDiamond();
                break;

            case "LargeConfetti":
                patternDict = LargeConfetti();
                break;

            case "SmallConfetti":
                patternDict = SmallConfetti();
                break;

            case "HorizontalBrick":
                patternDict = HorizontalBrick();
                break;

            case "DiagonalBrick":
                patternDict = DiagonalBrick();
                break;

            case "SolidDiamond":
                patternDict = SolidDiamond();
                break;

            case "Cross":
                patternDict = Cross();
                break;

            case "CheckerBoard":
                patternDict = CheckerBoard();
                break;
            }
        }
示例#9
0
 public PdfPage(PdfAnchor pa) : base(pa)
 {
     resourceDict  = null;
     contents      = null;
     pageSize      = null;
     fontRef       = null;
     imageRef      = null;
     annotsDict    = null;
     colorSpaceRef = null;
     patternRef    = null;
 }
示例#10
0
		public PdfPage(PdfAnchor pa):base(pa)
		{
			resourceDict=null;
			contents=null;
			pageSize=null;
			fontRef=null;
			imageRef=null;
			annotsDict=null;
			colorSpaceRef=null;
			patternRef=null;
		}
示例#11
0
        public void Start()
        {
            // Create the anchor for all pdf objects
            CompressionConfig cc = RdlEngineConfig.GetCompression();

            anchor = new PdfAnchor(cc != null);

            //Create a PdfCatalog
            string lang;

            if (r.ReportDefinition.Language != null)
            {
                lang = r.ReportDefinition.Language.EvaluateString(this.r, null);
            }
            else
            {
                lang = null;
            }
            catalog = new PdfCatalog(anchor, lang);

            //Create a Page Tree Dictionary
            pageTree = new PdfPageTree(anchor);

            //Create a Font Dictionary
            fonts = new PdfFonts(anchor);

            //Create a Pattern Dictionary
            patterns = new PdfPattern(anchor);

            //Create an Image Dictionary
            images = new PdfImages(anchor);

            //Create an Outline Dictionary
            outline = new PdfOutline(anchor);

            //Create the info Dictionary
            info = new PdfInfo(anchor);

            //Set the info Dictionary.
            info.SetInfo(r.Name, r.Author, r.Description, "");          // title, author, subject, company

            //Create a utility object
            pdfUtility = new PdfUtility(anchor);

            //write out the header
            int size = 0;

            tw.Write(pdfUtility.GetHeader("1.5", out size), 0, size);
            filesize = size;
        }
		public void Start()		
		{
			// Create the anchor for all pdf objects
			CompressionConfig cc = RdlEngineConfig.GetCompression();
			anchor = new PdfAnchor(cc != null);

			//Create a PdfCatalog
			string lang;
			if (r.ReportDefinition.Language != null)
				lang = r.ReportDefinition.Language.EvaluateString(this.r, null);
			else
				lang = null;
			catalog= new PdfCatalog(anchor, lang);

			//Create a Page Tree Dictionary
			pageTree= new PdfPageTree(anchor);

			//Create a Font Dictionary
			fonts = new PdfFonts(anchor);

            //Create a Pattern Dictionary
            patterns = new PdfPattern(anchor);

			//Create an Image Dictionary
			images = new PdfImages(anchor);

            //Create an Outline Dictionary
            outline = new PdfOutline(anchor);

            //Create the info Dictionary
			info=new PdfInfo(anchor);

			//Set the info Dictionary. 
			info.SetInfo(r.Name,r.Author,r.Description,"");	// title, author, subject, company

			//Create a utility object
			pdfUtility=new PdfUtility(anchor);

			//write out the header
			int size=0;
			tw.Write(pdfUtility.GetHeader("1.5",out size),0,size);
            filesize = size;
		}
        float _y;               // y location on page

		/// <summary>
		/// Create the image Dictionary
		/// </summary>
		public PdfOutlineEntry(PdfAnchor pa, int p, string text, float x, float y ):base(pa)
		{
            _p = p;
            _x = x;
            _y = y;
            _text = text;
		}
        public PdfPattern(PdfAnchor a)
		{
			pa = a;
			patterns = new Hashtable();
		}
示例#15
0
 public PdfPageTree(PdfAnchor pa) : base(pa)
 {
     kids     = "[ ";
     MaxPages = 0;
 }
示例#16
0
 public PdfPattern(PdfAnchor a)
 {
     pa       = a;
     patterns = new Hashtable();
 }
示例#17
0
		public PdfPageTree(PdfAnchor pa):base(pa)
		{
			kids="[ "; 
			MaxPages=0;
		}
		/// <summary>
		/// Create the font Dictionary
		/// </summary>
		public PdfPatternEntry(PdfAnchor pa,String patternName,String patternType):base(pa)
		{
            pattern = patternName;    
            switch (patternType)
            {
            	case "BackwardDiagonal":
            		patternDict = BackwardDiagonal();
            		break;
            	case "DarkDownwardDiagonal":
            		patternDict = DarkDownwardDiagonal();
            		break;
            	case "DarkHorizontal":
            		patternDict = DarkHorizontal();
            		break;
            	case "Vertical":
            		patternDict = Vertical();
            		break;
            	case "OutlinedDiamond":
            		patternDict = OutlinedDiamond();
            		break;
            	case "LargeConfetti":
            		patternDict = LargeConfetti();
            		break;
            	case "SmallConfetti":
            		patternDict = SmallConfetti();
            		break;
            	case "HorizontalBrick":
            		patternDict = HorizontalBrick();
            		break;
            	case "DiagonalBrick":
            		patternDict = DiagonalBrick();
            		break;
            	case "SolidDiamond":
            		patternDict = SolidDiamond();
            		break;
            	case "Cross":
            		patternDict = Cross();
            		break;
            	case "CheckerBoard":
            		patternDict = CheckerBoard();
            		break;            			
            }
        }
示例#19
0
 /// <summary>
 /// Constructor increments the object number to
 /// reflect the currently used object number
 /// </summary>
 protected PdfBase(PdfAnchor pa)
 {
     xref = pa;
     xref.current++;
     objectNum = xref.current;
 }
        public PdfOutline(PdfAnchor pa)
		{
            _pa = pa;
            bookmarks = new List<PdfOutlineEntry>();
		}
 public PdfUtility(PdfAnchor p)
 {
     pa = p;
     numTableEntries = 0;
 }
示例#22
0
 public PdfFonts(PdfAnchor a)
 {
     pa    = a;
     fonts = new Hashtable();
 }
示例#23
0
 public PatternObj(PdfAnchor pa) : base(pa)
 {
     Patternobj = string.Format("\r\n{0} 0 obj\r\n [ /Pattern /DeviceRGB ]\r\n endobj", this.objectNum);
 }
		public PatternObj(PdfAnchor pa):base(pa)
		{
			Patternobj = string.Format("\r\n{0} 0 obj\r\n [ /Pattern /DeviceRGB ]\r\n endobj",this.objectNum);
		}
示例#25
0
		/// <summary>
		/// Create the image Dictionary
		/// </summary>
		public PdfImageEntry(PdfAnchor pa, PdfPage p, int contentRef, string nm, ImageFormat imgf, byte[] im, int width, int height):base(pa)
		{
			name=nm;
			imf = imgf;
			ba=im;

			string filter;
            string colorSpace;
            if (imf == ImageFormat.Jpeg)
            {
                filter = "/DCTDecode";

                switch (JpgParser.GetColorSpace(ref im))
                {   
                    case 0:
                        colorSpace = "/DeviceRGB";
                        break;
                    case 1:
                        colorSpace = "/DeviceGray";
                        break;
                    case 3:
                        colorSpace = "/DeviceRGB";
                        break;
                    case 4:
                        colorSpace = "/DeviceCMYK";
                        break;
                    default:
                        colorSpace = "/DeviceRGB";
                        break;
                }
            }
            else if (imf == ImageFormat.Png)    // TODO: this still doesn't work
            {
                filter = "/FlateDecode /DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 8 /Columns 80>>";
                colorSpace = "/DeviceRGB";
            }
            else if (imf == ImageFormat.Gif)    // TODO: this still doesn't work
            {
                filter = "/LZWDecode";
                colorSpace = "/DeviceRGB";
            }
            else
            {
                filter = "";
                colorSpace = "";
            }
			imgDict=string.Format("\r\n{0} 0 obj<</Type/XObject/Subtype /Image /Width {1} /Height {2} /ColorSpace {5} /BitsPerComponent 8 /Length {3} /Filter {4} >>\nstream\n",
				this.objectNum,width, height, ba.Length, filter, colorSpace);
					
			p.AddResource(this, contentRef);
		}
示例#26
0
 public PdfImages(PdfAnchor a)
 {
     pa     = a;
     images = new Hashtable();
 }
示例#27
0
 public PdfOutlineMain(PdfAnchor pa)
     : base(pa)
 {
 }
示例#28
0
		/// <summary>
		/// Create the font Dictionary
		/// </summary>
		public PdfFontEntry(PdfAnchor pa,string fontName,string fontFace):base(pa)
		{
			font=fontName;
            fontDict = string.Format("\r\n{0} 0 obj<</Type/Font/Name /{1}/BaseFont/{2}/Subtype/Type1/Encoding /WinAnsiEncoding>>\tendobj\t",
                this.objectNum, fontName, fontFace);
            //fontDict = string.Format("\r\n{0} 0 obj<</Type/Font/Name /{1}/BaseFont/{2}/Subtype/Type1>>\tendobj\t",
            //    this.objectNum, fontName, fontFace);
        }
示例#29
0
 public PdfOutline(PdfAnchor pa)
 {
     _pa       = pa;
     bookmarks = new List <PdfOutlineEntry>();
 }
示例#30
0
		public PdfFonts(PdfAnchor a)
		{
			pa = a;
			fonts = new Hashtable();
		}
示例#31
0
		public PdfImages(PdfAnchor a)
		{
			pa = a;
			images = new Hashtable();
		}
示例#32
0
		/// <summary>
		/// Constructor increments the object number to 
		/// reflect the currently used object number
		/// </summary>
		protected PdfBase(PdfAnchor pa)
		{
			xref=pa;
			xref.current++;
			objectNum=xref.current;
		}
 public PdfUtility(PdfAnchor p)
 {
     pa = p;
     numTableEntries = 0;
 }
 public PdfOutlineMain(PdfAnchor pa)
     : base(pa)
 {
 }
示例#35
0
 public PdfInfo(PdfAnchor pa) : base(pa)
 {
     info = null;
 }
示例#36
0
		public PdfInfo(PdfAnchor pa):base(pa)
		{
			info=null;
		}