/// <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); }
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; }
/// <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); }
/// <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); }
public PdfTextArea(System.Drawing.Font Font, Color Color, PdfArea TextArea, HorizontalAlignment horAlignment, VerticalAlignment verAlignment, string Text) : this(Font, Color, TextArea, horAlignment, verAlignment, Text, false) { }
/// <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) { }
/// <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) { }