Esempio n. 1
0
        public override void DrawItem(PdfWriter pdfWriter,
                                      ICSharpCode.Reports.Core.Exporter.ExportRenderer.PdfUnitConverter converter)
        {
            if (pdfWriter == null)
            {
                throw new ArgumentNullException("pdfWriter");
            }
            if (converter == null)
            {
                throw new ArgumentNullException("converter");
            }
            base.DrawItem(pdfWriter, converter);

            iTextSharp.text.Font font = null;

            if (this.StyleDecorator.Font.Unit == GraphicsUnit.Point)
            {
                font = FontFactory.GetFont(this.StyleDecorator.Font.FontFamily.Name,
                                           BaseFont.IDENTITY_H,
                                           this.StyleDecorator.Font.Size,
                                           (int)this.StyleDecorator.Font.Style,
                                           this.StyleDecorator.PdfForeColor);
            }
            else
            {
                font = FontFactory.GetFont(this.StyleDecorator.Font.FontFamily.Name,
                                           BaseFont.IDENTITY_H,
                                           UnitConverter.FromPixel(this.StyleDecorator.Font.Size).Point,
                                           (int)this.StyleDecorator.Font.Style,
                                           this.StyleDecorator.PdfForeColor);
            }

            base.Decorate();

            PdfContentByte contentByte = base.PdfWriter.DirectContent;

            CalculatePdfFormat pdfFormat = new CalculatePdfFormat(this.StyleDecorator, font);

            ColumnText columnText = new ColumnText(contentByte);

            iTextSharp.text.Rectangle r = base.ConvertToPdfRectangle();
            columnText.SetSimpleColumn(r.Left, r.Top, r.Left + r.Width, r.Top - r.Height, pdfFormat.Leading, pdfFormat.Alignment);

            string formatedText = this.text;

            if (!String.IsNullOrEmpty(StyleDecorator.FormatString))
            {
                formatedText = StandardFormatter.FormatOutput(this.text, this.StyleDecorator.FormatString,
                                                              this.StyleDecorator.DataType, String.Empty);
            }

            Chunk chunk = new Chunk(formatedText, font);

            columnText.AddText(chunk);

            columnText.Go();
        }
Esempio n. 2
0
		public override void DrawItem(PdfWriter pdfWriter,
		                              ICSharpCode.Reports.Core.Exporter.ExportRenderer.PdfUnitConverter converter)
		{
			if (pdfWriter == null) {
				throw new ArgumentNullException("pdfWriter");
			}
			if (converter == null) {
				throw new ArgumentNullException("converter");
			}
			base.DrawItem(pdfWriter,converter);
			
			iTextSharp.text.Font font = null;
			
			if (this.StyleDecorator.Font.Unit == GraphicsUnit.Point) {
				
				font = FontFactory.GetFont(this.StyleDecorator.Font.FontFamily.Name,
				                           BaseFont.IDENTITY_H,
				                           this.StyleDecorator.Font.Size,
				                           (int)this.StyleDecorator.Font.Style,
				                           this.StyleDecorator.PdfForeColor);
				
			} else {
				
				font = FontFactory.GetFont(this.StyleDecorator.Font.FontFamily.Name,
				                           BaseFont.IDENTITY_H,
				                           UnitConverter.FromPixel(this.StyleDecorator.Font.Size).Point,
				                           (int)this.StyleDecorator.Font.Style,
				                           this.StyleDecorator.PdfForeColor);
			}

			base.Decorate();
			
			PdfContentByte contentByte = base.PdfWriter.DirectContent;
		
			CalculatePdfFormat pdfFormat = new CalculatePdfFormat(this.StyleDecorator,font);
			
			ColumnText columnText = new ColumnText(contentByte);
			iTextSharp.text.Rectangle r = base.ConvertToPdfRectangle();
			columnText.SetSimpleColumn(r.Left, r.Top , r.Left + r.Width,r.Top - r.Height,pdfFormat.Leading,pdfFormat.Alignment);
		
			string formatedText = this.text;
			
			if (!String.IsNullOrEmpty(StyleDecorator.FormatString)) {
				formatedText = StandardFormatter.FormatOutput(this.text,this.StyleDecorator.FormatString,
				                                                 this.StyleDecorator.DataType,String.Empty);
			}
			
			Chunk chunk = new Chunk(formatedText,font);

			columnText.AddText(chunk);
			
			columnText.Go();
		}
Esempio n. 3
0
        public override void DrawItem(PdfWriter pdfWriter,
                                      ICSharpCode.Reports.Core.Exporter.ExportRenderer.PdfUnitConverter converter)
        {
            if (pdfWriter == null)
            {
                throw new ArgumentNullException("pdfWriter");
            }
            if (converter == null)
            {
                throw new ArgumentNullException("converter");
            }
            base.DrawItem(pdfWriter, converter);

            base.Decorate();

            PdfContentByte contentByte = base.PdfWriter.DirectContent;

            iTextSharp.text.Font font      = CreateFontFromFactory(this.StyleDecorator);
            CalculatePdfFormat   pdfFormat = new CalculatePdfFormat(this.StyleDecorator, font);

            ColumnText columnText = new ColumnText(contentByte);

            if (StyleDecorator.RightToLeft.ToString() == "Yes")
            {
                columnText.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
            }

            iTextSharp.text.Rectangle r = base.ConvertToPdfRectangle();
            columnText.SetSimpleColumn(r.Left, r.Top, r.Left + r.Width, r.Top - r.Height, pdfFormat.Leading, pdfFormat.Alignment);

            string formatedText = this.Text;

            if (!String.IsNullOrEmpty(StyleDecorator.FormatString))
            {
                formatedText = StandardFormatter.FormatOutput(this.Text, this.StyleDecorator.FormatString,
                                                              this.StyleDecorator.DataType, String.Empty);
            }

            Chunk chunk = new Chunk(formatedText, font);

            columnText.AddText(chunk);

            columnText.Go();
        }
Esempio n. 4
0
		public override void DrawItem(PdfWriter pdfWriter,
		                              ICSharpCode.Reports.Core.Exporter.ExportRenderer.PdfUnitConverter converter)
		{
			if (pdfWriter == null) {
				throw new ArgumentNullException("pdfWriter");
			}
			if (converter == null) {
				throw new ArgumentNullException("converter");
			}
			base.DrawItem(pdfWriter,converter);

			base.Decorate();
	
			PdfContentByte contentByte = base.PdfWriter.DirectContent;
			
			iTextSharp.text.Font font = CreateFontFromFactory(this.StyleDecorator);
			CalculatePdfFormat pdfFormat = new CalculatePdfFormat(this.StyleDecorator,font);
			
			ColumnText columnText = new ColumnText(contentByte);

			if (StyleDecorator.RightToLeft.ToString() == "Yes") {
				columnText.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
			}
			
			iTextSharp.text.Rectangle r = base.ConvertToPdfRectangle();
			columnText.SetSimpleColumn(r.Left, r.Top , r.Left + r.Width,r.Top - r.Height,pdfFormat.Leading,pdfFormat.Alignment);
		
			string formatedText = this.Text;
			
			if (!String.IsNullOrEmpty(StyleDecorator.FormatString)) {
				formatedText = StandardFormatter.FormatOutput(this.Text,this.StyleDecorator.FormatString,
				                                                 this.StyleDecorator.DataType,String.Empty);
			}
			
			Chunk chunk = new Chunk(formatedText,font);

			columnText.AddText(chunk);
			
			columnText.Go();
		}