Exemplo n.º 1
0
        /// <summary>
        /// Generates a new Area inside the base one specifing the width difference.
        /// </summary>
        /// <param name="Difference">the Width difference of the inner Area</param>
        /// <returns></returns>
        public PdfArea InnerArea(double Difference)
        {
            this.PdfDocument = PdfDocument;
            if (Difference < 0)
            {
                throw new Exception("Difference must be non negative.");
            }
            PdfArea pa = this.MemberwiseClone() as PdfArea;

            pa.width  -= (double)Difference;
            pa.Height -= (double)Difference;
            pa.posx   += (double)Difference / 2;
            pa.posy   += (double)Difference / 2;
            return(pa);
        }
Exemplo n.º 2
0
        internal void SetArea()
        {
            this.area = this.CellArea(startRow, 0).Merge(this.CellArea(endRow, 0));

            double great = 0;

            foreach (PdfArea pa in this.cellAreas.Values)
            {
                double d = pa.BottomRightCornerX;
                if (d > great)
                {
                    great = d;
                }
            }
            this.area.BottomRightCornerX = great;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates the TablePage, the rasterized page of a Table.
        /// </summary>
        /// <param name="PageArea"></param>
        /// <returns></returns>
        public PdfTablePage CreateTablePage(PdfArea PageArea)
        {
            this.TableArea = PageArea.Clone();
            PdfTablePage ptp;

            if (!this.visibleHeaders)
            {
                ptp = this.createTablePage();
            }
            else
            {
                this.header.TableArea = PageArea.Clone();
                double headerHeight = this.HeadersRow.Height;
                this.header.TableArea.height = headerHeight;
                this.TableArea.posy         += headerHeight;
                this.TableArea.height       -= headerHeight;

                this.TableArea.height = this.TableArea.height * 1.0000001;

                ptp = this.createTablePage();


                ByteBuffer byteBuffer = new ByteBuffer();
                byteBuffer.Append(ptp.byteStream);

                if (this.visibleHeaders)
                {
                    byteBuffer.Append(this.header.createTablePage().byteStream);
                }

                ptp.byteStream = byteBuffer.ToByteArray();

                this.header.renderingIndex = 0;
            }


            foreach (PdfColumn pc in this.Columns)
            {
                pc.CompensatedWidth = -1;
            }
            foreach (PdfColumn pc in this.header.Columns)
            {
                pc.CompensatedWidth = -1;
            }
            return(ptp);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Generates a new Area outside the base one specifing the width difference.
        /// </summary>
        /// <param name="WidthDifference">the Width difference of the inner Area</param>
        /// <param name="HeightDifference">the Height difference of the inner Area</param>
        /// <returns></returns>
        public PdfArea OuterArea(double WidthDifference, double HeightDifference)
        {
            if (WidthDifference < 0)
            {
                throw new Exception("WidthDifference must be non negative.");
            }
            if (HeightDifference < 0)
            {
                throw new Exception("HeightDifference must be non negative.");
            }
            PdfArea pa = this.MemberwiseClone() as PdfArea;

            pa.width  += (double)WidthDifference;
            pa.Height += (double)HeightDifference;
            pa.posx   -= (double)WidthDifference / 2;
            pa.posy   -= (double)HeightDifference / 2;
            return(pa);
        }
Exemplo n.º 5
0
 public PdfTextArea(System.Drawing.Font Font, Color Color, PdfArea TextArea, HorizontalAlignment horAlignment, VerticalAlignment verAlignment, string Text) : this(Font, Color, TextArea, horAlignment, verAlignment, Text, false)
 {
 }
Exemplo n.º 6
0
 /// <summary>
 /// creates a new rectangle
 /// </summary>
 /// <param name="RectangleArea"></param>
 /// <param name="BorderColor"></param>
 /// <param name="FillingColor"></param>
 public PdfRectangle(PdfDocument PdfDocument, PdfArea RectangleArea, Color BorderColor, Color FillingColor) : this(PdfDocument, RectangleArea, BorderColor, 0, FillingColor)
 {
 }
Exemplo n.º 7
0
 /// <summary>
 /// creates a new rectangle
 /// </summary>
 /// <param name="RectangleArea"></param>
 /// <param name="BorderColor"></param>
 /// <param name="BorderWidth"></param>
 public PdfRectangle(PdfDocument PdfDocument, PdfArea RectangleArea, Color BorderColor, double BorderWidth) : this(PdfDocument, RectangleArea, BorderColor, BorderWidth, Color.Transparent)
 {
 }