Пример #1
0
		internal PdfContent(PdfAnchor pa):base(pa)
		{
			CanCompress = pa.CanCompress;
			content=null;
//			contentStream="%stream\r";
			contentStream="";
		}
Пример #2
0
        /// <summary>
        /// Create the image Dictionary
        /// </summary>
        internal 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;

            if (imf == ImageFormat.Jpeg)
            {
                filter = "/DCTDecode";
            }
            else if (imf == ImageFormat.Png)                // TODO: this still doesn't work
            {
                filter = "/FlateDecode /DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 8 /Columns 80>>";
            }
            else if (imf == ImageFormat.Gif)                // TODO: this still doesn't work
            {
                filter = "/LZWDecode";
            }
            else
            {
                filter = "";
            }

            imgDict = string.Format("\r\n{0} 0 obj<</Type/XObject/Subtype /Image /Width {1} /Height {2} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Length {3} /Filter {4} >>\nstream\n",
                                    this.objectNum, width, height, ba.Length, filter);

            p.AddResource(this, contentRef);
        }
Пример #3
0
        float _y;               // y location on page

        /// <summary>
        /// Create the image Dictionary
        /// </summary>
        internal PdfOutlineEntry(PdfAnchor pa, int p, string text, float x, float y) : base(pa)
        {
            _p    = p;
            _x    = x;
            _y    = y;
            _text = text;
        }
Пример #4
0
        internal PdfContent(PdfAnchor pa) : base(pa)
        {
            CanCompress = pa.CanCompress;
            content     = null;
//			contentStream="%stream\r";
            contentStream = "";
        }
Пример #5
0
		internal PdfCatalog(PdfAnchor pa, string l):base(pa)
		{
			if (l != null)
				lang = String.Format("/Lang({0})", l);
			else
				lang = "";
		}
Пример #6
0
 /// <summary>
 /// Create the font Dictionary
 /// </summary>
 internal 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);
 }
Пример #7
0
		internal PdfPage(PdfAnchor pa):base(pa)
		{
			resourceDict=null;
			contents=null;
			pageSize=null;
			fontRef=null;
			imageRef=null;
			annotsDict=null;
		}
Пример #8
0
 /// <summary>
 /// Create the font Dictionary
 /// </summary>
 internal 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);
 }
Пример #9
0
 internal PdfPage(PdfAnchor pa) : base(pa)
 {
     resourceDict = null;
     contents     = null;
     pageSize     = null;
     fontRef      = null;
     imageRef     = null;
     annotsDict   = null;
 }
Пример #10
0
        /// <summary>
        /// Create the image Dictionary
        /// </summary>
        internal 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 == ImageFormatType.Png)    // TODO: this still doesn't work
            //{
            //    filter = "/FlateDecode /DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 8 /Columns 80>>";
            //    colorSpace = "/DeviceRGB";
            //}
            //else if (imf == ImageFormatType.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);
        }
Пример #11
0
        /// <summary>
        /// Create the font Dictionary
        /// </summary>
        internal 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;
            }
        }
Пример #12
0
 internal PdfCatalog(PdfAnchor pa, string l) : base(pa)
 {
     if (l != null)
     {
         lang = String.Format("/Lang({0})", l);
     }
     else
     {
         lang = "";
     }
 }
Пример #13
0
        /// <summary>
        /// Create the image Dictionary
        /// </summary>
        internal 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);
        }
Пример #14
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;
        }
Пример #15
0
        /// <summary>
        /// Create the font Dictionary
        /// </summary>
        internal PdfFontEntry(PdfAnchor pa, string fontName, string fontFace) : base(pa)
        {
            font = fontName;

            if (fontFace == "AdobeSongStd-Light")
            {
                fontDict = string.Format("\r\n{0} 0 obj<</Type/Font/Name /{1}/BaseFont/{2}/Subtype/CIDFont>>\tendobj\t",
                                         this.objectNum, fontName, fontFace);
            }
            else
            {
                //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);
            }
        }
Пример #16
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 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;
		}
Пример #17
0
 internal PdfOutline(PdfAnchor pa)
 {
     _pa = pa;
     bookmarks = new List<PdfOutlineEntry>();
 }
Пример #18
0
 internal PdfOutlineMain(PdfAnchor pa)
     : base(pa)
 {
 }
Пример #19
0
        float _y; // y location on page

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Create the image Dictionary
        /// </summary>
        internal PdfOutlineEntry(PdfAnchor pa, int p, string text, float x, float y )
            : base(pa)
        {
            _p = p;
            _x = x;
            _y = y;
            _text = text;
        }
Пример #20
0
		/// <summary>
		/// Create the image Dictionary
		/// </summary>
		internal 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;
			if (imf == ImageFormat.Jpeg)
				filter = "/DCTDecode";
			else if (imf == ImageFormat.Png)    // TODO: this still doesn't work
                filter = "/FlateDecode /DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 8 /Columns 80>>";
			else if (imf == ImageFormat.Gif)    // TODO: this still doesn't work
				filter = "/LZWDecode";
			else
				filter = "";

			imgDict=string.Format("\r\n{0} 0 obj<</Type/XObject/Subtype /Image /Width {1} /Height {2} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Length {3} /Filter {4} >>\nstream\n",
				this.objectNum,width, height, ba.Length, filter);
					
			p.AddResource(this, contentRef);
		}
Пример #21
0
 internal PdfInfo(PdfAnchor pa) : base(pa)
 {
     info = null;
 }
Пример #22
0
 internal PdfUtility(PdfAnchor p)
 {
     pa = p;
     numTableEntries = 0;
 }
Пример #23
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;
 }
Пример #24
0
		/// <summary>
		/// Create the font Dictionary
		/// </summary>
		internal 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;            			
            }
        }
Пример #25
0
 internal PdfPageTree(PdfAnchor pa) : base(pa)
 {
     kids     = "[ ";
     MaxPages = 0;
 }
Пример #26
0
		internal PdfPageTree(PdfAnchor pa):base(pa)
		{
			kids="[ "; 
			MaxPages=0;
		}
Пример #27
0
 internal PdfFonts(PdfAnchor a)
 {
     pa    = a;
     fonts = new Hashtable();
 }
Пример #28
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;

            if (r.ItextPDF)
            {
                PdfWriter writer = PdfWriter.GetInstance(pdfdocument, ms);
                pdfdocument.Open();
                cb = writer.DirectContent;
                pdfdocument.AddAuthor(r.Author);
                pdfdocument.AddCreationDate();
                pdfdocument.AddCreator("Majorsilence Reporting");
                pdfdocument.AddSubject(r.Description);
                pdfdocument.AddTitle(r.Name);

            }
            else
            {
                tw.Write(pdfUtility.GetHeader("1.5", out size), 0, size);
            }

            //
            filesize = size;
        }
Пример #29
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;
		}
Пример #30
0
		internal PatternObj(PdfAnchor pa):base(pa)
		{
			Patternobj = string.Format("\r\n{0} 0 obj\r\n [ /Pattern /DeviceRGB ]\r\n endobj",this.objectNum);
		}
Пример #31
0
 internal PdfPattern(PdfAnchor a)
 {
     pa       = a;
     patterns = new Hashtable();
 }
Пример #32
0
 internal PdfUtility(PdfAnchor p)
 {
     pa = p;
     numTableEntries = 0;
 }
Пример #33
0
 internal PdfOutlineMain(PdfAnchor pa)
     : base(pa)
 {
 }
Пример #34
0
 internal PatternObj(PdfAnchor pa) : base(pa)
 {
     Patternobj = string.Format("\r\n{0} 0 obj\r\n [ /Pattern /DeviceRGB ]\r\n endobj", this.objectNum);
 }
Пример #35
0
 internal PdfOutline(PdfAnchor pa)
 {
     _pa       = pa;
     bookmarks = new List <PdfOutlineEntry>();
 }
Пример #36
0
 internal PdfInfo(PdfAnchor pa)
     : base(pa)
 {
     info=null;
 }
Пример #37
0
		internal PdfFonts(PdfAnchor a)
		{
			pa = a;
			fonts = new Hashtable();
		}
Пример #38
0
		internal PdfImages(PdfAnchor a)
		{
			pa = a;
			images = new Hashtable();
		}
Пример #39
0
 internal PdfImages(PdfAnchor a)
 {
     pa     = a;
     images = new Hashtable();
 }
Пример #40
0
        internal PdfPattern(PdfAnchor a)
		{
			pa = a;
			patterns = new Hashtable();
		}