Esempio n. 1
0
 /// <summary>
 ///     PDF table style constructor as a copy of another style.
 /// </summary>
 /// <param name="Other">Copy constructor.</param>
 public PdfTableStyle
 (
     PdfTableStyle Other
 )
 {
     Copy(Other);
 }
Esempio n. 2
0
 ////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Copy one style to another
 /// </summary>
 /// <param name="SourceStyle">Source style</param>
 ////////////////////////////////////////////////////////////////////
 public void Copy
 (
     PdfTableStyle SourceStyle
 )
 {
     Alignment                  = SourceStyle.Alignment;
     BackgroundColor            = SourceStyle.BackgroundColor;
     BarcodeBarWidth            = SourceStyle.BarcodeBarWidth;
     BarcodeHeight              = SourceStyle.BarcodeHeight;
     TextBoxFirstLineIndent     = SourceStyle.TextBoxFirstLineIndent;
     TextBoxLineBreakFactor     = SourceStyle.TextBoxLineBreakFactor;
     TextBoxLineExtraSpace      = SourceStyle.TextBoxLineExtraSpace;
     TextBoxParagraphExtraSpace = SourceStyle.TextBoxParagraphExtraSpace;
     TextBoxTextJustify         = SourceStyle.TextBoxTextJustify;
     Font                     = SourceStyle.Font;
     FontSize                 = SourceStyle.FontSize;
     ForegroundColor          = SourceStyle.ForegroundColor;
     Format                   = SourceStyle.Format;
     Margin                   = new PdfRectangle(SourceStyle.Margin);
     RaiseCustomDrawCellEvent = SourceStyle.RaiseCustomDrawCellEvent;
     TextDrawStyle            = SourceStyle.TextDrawStyle;
     MinHeight                = SourceStyle.MinHeight;
     MultiLineText            = SourceStyle.MultiLineText;
     NumberFormatInfo         = SourceStyle.NumberFormatInfo;
     return;
 }
Esempio n. 3
0
 /// <summary>
 /// PDF table style constructor as a copy of another style.
 /// </summary>
 /// <param name="Other">Copy constructor.</param>
 public PdfTableStyle
 (
     PdfTableStyle Other
 )
 {
     Copy(Other);
     return;
 }
Esempio n. 4
0
        /// <summary>
        ///     PdfTable constructor.
        /// </summary>
        /// <param name="Page">Current PdfPage.</param>
        /// <param name="Contents">Current PdfContents.</param>
        /// <param name="Font">Table's default font.</param>
        /// <param name="FontSize">Table's default font size.</param>
        public PdfTable
        (
            PdfPage Page,
            PdfContents Contents,
            PdfFont Font    = null,
            double FontSize = 9.0
        )
        {
            // save arguments
            Document      = Page.Document;
            this.Page     = Page;
            this.Contents = Contents;

            // See if at least one font is defined. Make it the default font for the table
            if (Font == null)
            {
                foreach (var Obj in Document.ObjectArray)
                {
                    if (Obj.GetType() == typeof(PdfFont))
                    {
                        Font = (PdfFont)Obj;
                        break;
                    }
                }
            }

            // initialize default cell style
            DefaultCellStyle = new PdfTableStyle
            {
                Font     = Font,
                FontSize = FontSize
            };
            DefaultCellStyle.Margin.Left   = DefaultCellStyle.Margin.Right = 3.0 / Document.ScaleFactor;
            DefaultCellStyle.Margin.Bottom = DefaultCellStyle.Margin.Top = 1.0 / Document.ScaleFactor;

            // initialize default header style
            DefaultHeaderStyle = CellStyle;
            DefaultHeaderStyle.BackgroundColor = Color.LightGray;

            // default table area
            TableArea = new PdfRectangle(72.0 / Page.ScaleFactor, 72.0 / Page.ScaleFactor,
                                         (Page.Width - 72.0) / Page.ScaleFactor, (Page.Height - 72.0) / Page.ScaleFactor);

            // set header on each page as the default
            HeaderOnEachPage = true;

            // create table border control
            Borders = new PdfTableBorder(this);

            // very small amount 1/300 of an inch
            // used to guard against rounding errors
            Epsilon = Document.Epsilon;
        }
Esempio n. 5
0
        /// <summary>
        /// PdfTable constructor.
        /// </summary>
        /// <param name="Page">Current PdfPage.</param>
        /// <param name="Contents">Current PdfContents.</param>
        /// <param name="Font">Table's default font.</param>
        /// <param name="FontSize">Table's default font size.</param>
        public PdfTable(
			PdfPage		Page,
			PdfContents	Contents,
			PdfFont		Font = null,
			Double		FontSize = 9.0
			)
        {
            // save arguments
            this.Document = Page.Document;
            this.Page = Page;
            this.Contents = Contents;

            // See if at least one font is defined. Make it the default font for the table
            if(Font == null) foreach(PdfObject Obj in Document.ObjectArray) if(Obj.GetType() == typeof(PdfFont))
            {
            Font = (PdfFont) Obj;
            break;
            }

            // initialize default cell style
            DefaultCellStyle = new PdfTableStyle();
            DefaultCellStyle.Font = Font;
            DefaultCellStyle.FontSize = FontSize;
            DefaultCellStyle.Margin.Left = DefaultCellStyle.Margin.Right = 3.0 / Document.ScaleFactor;
            DefaultCellStyle.Margin.Bottom = DefaultCellStyle.Margin.Top = 1.0 / Document.ScaleFactor;

            // initialize default header style
            DefaultHeaderStyle = CellStyle;
            DefaultHeaderStyle.BackgroundColor = Color.LightGray;

            // default table area
            TableArea = new PdfRectangle(72.0 / Document.ScaleFactor, 72.0 / Document.ScaleFactor,
            (Document.PageSize.Width - 72.0) / Document.ScaleFactor, (Document.PageSize.Height - 72.0) / Document.ScaleFactor);

            // set header on each page as the default
            HeaderOnEachPage = true;

            // create table border control
            Borders = new PdfTableBorder(this);

            // very small amount 1/300 of an inch
            // used to guard against rounding errors
            Epsilon = 1.0 / (300.0 * Document.ScaleFactor);
            return;
        }
        /// <summary>
        /// PDF table style constructor as a copy of another style.
        /// </summary>
        /// <param name="Other">Copy constructor.</param>
        public PdfTableStyle(
			PdfTableStyle	Other
			)
        {
            Copy(Other);
            return;
        }
        ////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Copy one style to another 
        /// </summary>
        /// <param name="SourceStyle">Source style</param>
        ////////////////////////////////////////////////////////////////////
        public void Copy(
			PdfTableStyle	SourceStyle
			)
        {
            Alignment = SourceStyle.Alignment;
            BackgroundColor = SourceStyle.BackgroundColor;
            BarcodeBarWidth = SourceStyle.BarcodeBarWidth;
            BarcodeHeight = SourceStyle.BarcodeHeight;
            TextBoxFirstLineIndent = SourceStyle.TextBoxFirstLineIndent;
            TextBoxLineBreakFactor = SourceStyle.TextBoxLineBreakFactor;
            TextBoxLineExtraSpace = SourceStyle.TextBoxLineExtraSpace;
            TextBoxParagraphExtraSpace = SourceStyle.TextBoxParagraphExtraSpace;
            TextBoxTextJustify = SourceStyle.TextBoxTextJustify;
            Font = SourceStyle.Font;
            FontSize = SourceStyle.FontSize;
            ForegroundColor = SourceStyle.ForegroundColor;
            Format = SourceStyle.Format;
            Margin = new PdfRectangle(SourceStyle.Margin);
            RaiseCustomDrawCellEvent = SourceStyle.RaiseCustomDrawCellEvent;
            TextDrawStyle = SourceStyle.TextDrawStyle;
            MinHeight = SourceStyle.MinHeight;
            MultiLineText = SourceStyle.MultiLineText;
            NumberFormatInfo = SourceStyle.NumberFormatInfo;
            return;
        }