Example #1
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;
        }
Example #2
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);
        }
Example #3
0
        /// <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;
        }
Example #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);
        }
Example #5
0
 /// <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;
 }