/// <summary> /// creates a new rectangle /// </summary> /// <param name="RectangleArea">the area which will contains the rectangle</param> /// <param name="BorderColor"></param> public PdfRectangle(PdfDocument PdfDocument,PdfArea RectangleArea,Color BorderColor) { this.PdfDocument=PdfDocument; this.rectangleArea=RectangleArea; this.BorderColor=BorderColor; this.strokeWidth=1; }
/// <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=PdfDocument; if (BorderWidth<=0) throw new Exception("BorderWidth must be greater than zero."); this.rectangleArea=RectangleArea; this.BorderColor=BorderColor; this.strokeWidth=BorderWidth; }
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 a new Flow Text Area. /// </summary> /// <param name="TextArea">the PdfArea which will contains the Text.</param> /// <param name="Font">the starting Font of the writings.</param> /// <param name="Color">the starting Color of the writings.</param> public PdfFlowTextArea(PdfArea TextArea,Font Font,Color Color) { this.Stream=""; this.posX=TextArea.PosX; this.posY=TextArea.PosY; this.startX=TextArea.PosX; this.startY=TextArea.PosY; this.endX=TextArea.BottomRightCornerX; this.endY=TextArea.BottomRightCornerY; this.interline=Font.Size*1.6; this.Fonts=new ArrayList(); this.SetColor(Color); this.SetFont(Font); }
/// <summary> /// creates a circle with different x and y diamaters (ellipse) /// </summary> /// <param name="posx">center's x coordinate</param> /// <param name="posy">center's y coordinate</param> /// <param name="XDiameter">x diameter measure</param> /// <param name="YDiameter">y diameter measure</param> /// <param name="Color">circumference color</param> public PdfCircle(double posx, double posy, double XDiameter, double YDiameter, Color Color) { if (XDiameter <= 0) { throw new Exception("XDiameter must be grater than zero."); } if (YDiameter <= 0) { throw new Exception("YDiameter must be grater than zero."); } this.axesArea = new PdfArea(this.PdfDocument, posx - XDiameter / 2, posy - YDiameter / 2, XDiameter, YDiameter); this.BorderColor = Color; this.strokeWidth = 1; }
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> /// 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); }
/// <summary> /// Creates a new Flow Text Area. /// </summary> /// <param name="TextArea">the PdfArea which will contains the Text.</param> /// <param name="Font">the starting Font of the writings.</param> /// <param name="Color">the starting Color of the writings.</param> /// <param name="StartX">the starting X position of the writing cursor.</param> /// <param name="StartY">the starting Y position of the writing cursor.</param> public PdfFlowTextArea(PdfArea TextArea,Font Font,Color Color,double StartX,double StartY) { this.Stream=""; this.posX=TextArea.PosX; this.posY=TextArea.PosY; this.startX=StartX; this.startY=StartY; this.endX=TextArea.BottomRightCornerX; this.endY=TextArea.BottomRightCornerY; if (this.startX<this.posX||this.startX>this.endX) throw new Exception("Starting Point cannot be outside the FlowTextArea."); if (this.startY<this.posY||this.startY>this.endY) throw new Exception("Starting Point cannot be outside the FlowTextArea."); this.Fonts=new ArrayList(); this.SetColor(Color); this.SetFont(Font); this.interline=Font.Size*1.6; }
/// <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); }
/// <summary> /// Creates a new Flow Text Area. /// </summary> /// <param name="TextArea">the PdfArea which will contains the Text.</param> /// <param name="Font">the starting Font of the writings.</param> /// <param name="Color">the starting Color of the writings.</param> /// <param name="StartX">the starting X position of the writing cursor.</param> /// <param name="StartY">the starting Y position of the writing cursor.</param> /// <param name="Interline">the Interline Size.</param> public PdfFlowTextArea(PdfArea TextArea, Font Font, Color Color, double StartX, double StartY, double Interline) { this.Stream = ""; this.posX = TextArea.PosX; this.posY = TextArea.PosY; this.startX = StartX; this.startY = StartY; this.endX = TextArea.BottomRightCornerX; this.endY = TextArea.BottomRightCornerY; if (this.startX < this.posX || this.startX > this.endX) { throw new Exception("Starting Point cannot be outside the FlowTextArea."); } if (this.startY < this.posY || this.startY > this.endY) { throw new Exception("Starting Point cannot be outside the FlowTextArea."); } this.Fonts = new ArrayList(); this.SetColor(Color); this.SetFont(Font); this.interline = Interline; }
/// <summary> /// creates a circle with different x and y diamaters (ellipse) /// </summary> /// <param name="posx">center's x coordinate</param> /// <param name="posy">center's y coordinate</param> /// <param name="XDiameter">x diameter measure</param> /// <param name="YDiameter">y diameter measure</param> /// <param name="Color">circumference color</param> public PdfCircle(double posx,double posy,double XDiameter,double YDiameter,Color Color) { if (XDiameter<=0) throw new Exception("XDiameter must be grater than zero."); if (YDiameter<=0) throw new Exception("YDiameter must be grater than zero."); this.axesArea=new PdfArea(this.PdfDocument,posx-XDiameter/2,posy-YDiameter/2,XDiameter,YDiameter); this.BorderColor=Color; this.strokeWidth=1; }
/// <summary> /// creates a new circle /// </summary> /// <param name="posx">center's x coordinate</param> /// <param name="posy">center's y coordinate</param> /// <param name="ray">ray measure</param> /// <param name="Color">circumference color</param> public PdfCircle(double posx,double posy,double ray,Color Color) { if (ray<=0) throw new Exception("Ray must be grater than zero."); this.axesArea=new PdfArea(this.PdfDocument,posx-ray,posy-ray,ray*2,ray*2); this.BorderColor=Color; this.strokeWidth=1; }
/// <summary> /// sets the diameters lenght of the circle. /// </summary> /// <param name="XDiameter"></param> /// <param name="YDiameter"></param> public void SetDiameters(double XDiameter,double YDiameter) { if (XDiameter<=0) throw new Exception("XDiameter must be grater than zero."); if (YDiameter<=0) throw new Exception("YDiameter must be grater than zero."); this.axesArea=new PdfArea(this.PdfDocument,this.axesArea.CenterX-XDiameter/2,this.axesArea.CenterY-YDiameter/2,XDiameter,YDiameter); }
/// <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(); this.header.TableArea.height=this.HeadersRow.Height; this.TableArea.posy+=this.HeadersRow.Height; this.TableArea.height-=this.HeadersRow.Height; ptp=this.createTablePage(); ptp.stream+=this.header.createTablePage().stream; 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> /// Extends the area to the bounds of another area /// </summary> /// <param name="Area"></param> /// <returns></returns> public PdfArea Merge(PdfArea Area) { PdfArea res=this.MemberwiseClone() as PdfArea; if (this.PosX>Area.PosX) { res.PosX=Area.PosX; res.Width=Area.Width; } if (this.PosY>Area.PosY) { res.PosY=Area.PosY; res.Height=Area.Height; } if (this.BottomRightCornerX<Area.BottomRightCornerX) { res.BottomRightCornerX=Area.BottomRightCornerX; } if (this.BottomRightCornerY<Area.BottomRightCornerY) { res.BottomRightCornerY=Area.BottomRightCornerY; } return res; }
/// <summary> /// creates a new PdfTextArea /// </summary> /// <param name="Font">the font that will be used</param> /// <param name="Color">the color of the font that will be used</param> /// <param name="TextArea">the estabilished area for the Text</param> /// <param name="PdfTextAlign">the ContentAlignment for the Text inside the area</param> /// <param name="Text">the text that will be written inside the area</param> public PdfTextArea(System.Drawing.Font Font,System.Drawing.Color Color,PdfArea TextArea,ContentAlignment PdfTextAlign,string Text) { if (Text==null) throw new Exception("Text cannot be null."); this.Font=Font; this.Color=Color; this.textArea=TextArea; this.text=Text; this.textAlign=PdfTextAlign; this.lineHeight=(double)(Font.Size); }
/// <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=PdfDocument; this.rectangleArea=RectangleArea; this.BorderColor=BorderColor; this.FillingColor=FillingColor; this.filled=true; this.strokeWidth=1; }