Esempio n. 1
0
		internal PdfContent(PdfAnchor pa):base(pa)
		{
			CanCompress = pa.CanCompress;
			content=null;
//			contentStream="%stream\r";
			contentStream="";
		}
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 4
0
        internal PdfContent(PdfAnchor pa) : base(pa)
        {
            CanCompress = pa.CanCompress;
            content     = null;
//			contentStream="%stream\r";
            contentStream = "";
        }
Esempio n. 5
0
		internal PdfCatalog(PdfAnchor pa, string l):base(pa)
		{
			if (l != null)
				lang = String.Format("/Lang({0})", l);
			else
				lang = "";
		}
Esempio n. 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);
 }
Esempio n. 7
0
		internal PdfPage(PdfAnchor pa):base(pa)
		{
			resourceDict=null;
			contents=null;
			pageSize=null;
			fontRef=null;
			imageRef=null;
			annotsDict=null;
		}
Esempio n. 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);
 }
Esempio n. 9
0
 internal PdfPage(PdfAnchor pa) : base(pa)
 {
     resourceDict = null;
     contents     = null;
     pageSize     = null;
     fontRef      = null;
     imageRef     = null;
     annotsDict   = null;
 }
Esempio n. 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);
        }
Esempio n. 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;
            }
        }
Esempio n. 12
0
 internal PdfCatalog(PdfAnchor pa, string l) : base(pa)
 {
     if (l != null)
     {
         lang = String.Format("/Lang({0})", l);
     }
     else
     {
         lang = "";
     }
 }
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 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);
            }
        }
Esempio n. 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;
		}
Esempio n. 17
0
 internal PdfOutline(PdfAnchor pa)
 {
     _pa = pa;
     bookmarks = new List<PdfOutlineEntry>();
 }
Esempio n. 18
0
 internal PdfOutlineMain(PdfAnchor pa)
     : base(pa)
 {
 }
Esempio n. 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;
        }
Esempio n. 20
0
File: PdfImage.cs Progetto: mnisl/OD
		/// <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);
		}
Esempio n. 21
0
 internal PdfInfo(PdfAnchor pa) : base(pa)
 {
     info = null;
 }
Esempio n. 22
0
 internal PdfUtility(PdfAnchor p)
 {
     pa = p;
     numTableEntries = 0;
 }
Esempio n. 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;
 }
Esempio n. 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;            			
            }
        }
Esempio n. 25
0
 internal PdfPageTree(PdfAnchor pa) : base(pa)
 {
     kids     = "[ ";
     MaxPages = 0;
 }
Esempio n. 26
0
		internal PdfPageTree(PdfAnchor pa):base(pa)
		{
			kids="[ "; 
			MaxPages=0;
		}
Esempio n. 27
0
 internal PdfFonts(PdfAnchor a)
 {
     pa    = a;
     fonts = new Hashtable();
 }
Esempio n. 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;
        }
Esempio n. 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;
		}
Esempio n. 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);
		}
Esempio n. 31
0
 internal PdfPattern(PdfAnchor a)
 {
     pa       = a;
     patterns = new Hashtable();
 }
Esempio n. 32
0
 internal PdfUtility(PdfAnchor p)
 {
     pa = p;
     numTableEntries = 0;
 }
Esempio n. 33
0
 internal PdfOutlineMain(PdfAnchor pa)
     : base(pa)
 {
 }
Esempio n. 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);
 }
Esempio n. 35
0
 internal PdfOutline(PdfAnchor pa)
 {
     _pa       = pa;
     bookmarks = new List <PdfOutlineEntry>();
 }
Esempio n. 36
0
 internal PdfInfo(PdfAnchor pa)
     : base(pa)
 {
     info=null;
 }
Esempio n. 37
0
		internal PdfFonts(PdfAnchor a)
		{
			pa = a;
			fonts = new Hashtable();
		}
Esempio n. 38
0
		internal PdfImages(PdfAnchor a)
		{
			pa = a;
			images = new Hashtable();
		}
Esempio n. 39
0
 internal PdfImages(PdfAnchor a)
 {
     pa     = a;
     images = new Hashtable();
 }
Esempio n. 40
0
        internal PdfPattern(PdfAnchor a)
		{
			pa = a;
			patterns = new Hashtable();
		}