/// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="HEXColor">Hex Color</param>
 public pdfColor(string HEXColor)
 {
     _rColor = formatColorComponent(int.Parse(HEXColor.Substring(0, 2), System.Globalization.NumberStyles.HexNumber));
     _gColor = formatColorComponent(int.Parse(HEXColor.Substring(2, 2), System.Globalization.NumberStyles.HexNumber));
     _bColor = formatColorComponent(int.Parse(HEXColor.Substring(4, 2), System.Globalization.NumberStyles.HexNumber));
     _color  = predefinedColor.csUserColor;
 }
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="rColor">Red component of the color</param>
 /// <param name="gColor">Green component of the color</param>
 /// <param name="bColor">Blue component of the color</param>
 public pdfColor(int rColor, int gColor, int bColor)
 {
     _rColor = formatColorComponent(rColor);
     _gColor = formatColorComponent(gColor);
     _bColor = formatColorComponent(bColor);
     _color  = predefinedColor.csUserColor;
 }
Exemple #3
0
        /// <summary>
        /// Method that adds a line to the page object
        /// </summary>
        /// <param name="X">X position of the line in the page</param>
        /// <param name="Y">Y position of the line in the page</param>
        /// <param name="X1">X1 position of the line in the page</param>
        /// <param name="Y1">Y1 position of the line in the page</param>
        /// <param name="lineColor">Line's color</param>
        /// <param name="lineWidth">Line's size</param>
        public void drawLine(int X, int Y, int X1, int Y1, predefinedColor lineColor, int lineWidth)
        {
            lineElement objLine = new lineElement(X, Y, X1, Y1, lineWidth, lineColor);

            _elements.Add(objLine);
            objLine = null;
        }
Exemple #4
0
        /// <summary>
        /// Method that adds a line to the page object [DEPRECATED]
        /// </summary>
        /// <param name="X">X position of the line in the page</param>
        /// <param name="Y">Y position of the line in the page</param>
        /// <param name="X1">X1 position of the line in the page</param>
        /// <param name="Y1">Y1 position of the line in the page</param>
        /// <param name="lineColor">Line's color</param>
        public void drawLine(int X, int Y, int X1, int Y1, predefinedColor lineColor)
        {
            lineElement objLine = new lineElement(X, Y, X1, Y1, lineColor);

            _persistentElements.Add(objLine);
            objLine = null;
        }
Exemple #5
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 public pdfTableRowStyle(predefinedFont fontType, int fontSize, predefinedColor fontColor, predefinedColor bgColor)
 {
     _fontType  = fontType;
     _fontSize  = fontSize;
     _fontColor = new pdfColor(fontColor);
     _bgColor   = new pdfColor(bgColor);
 }
Exemple #6
0
        /// <summary>
        /// Method that adds a rectangle to the page object
        /// </summary>
        /// <param name="X">X position of the rectangle in the page</param>
        /// <param name="Y">Y position of the rectangle in the page</param>
        /// <param name="X1">X1 position of the rectangle in the page</param>
        /// <param name="Y1">Y1 position of the rectangle in the page</param>
        /// <param name="strokeColor">Border's color</param>
        /// <param name="fillColor">Rectancle's color</param>
        public void drawRectangle(int X, int Y, int X1, int Y1, predefinedColor strokeColor, predefinedColor fillColor)
        {
            rectangleElement objRectangle = new rectangleElement(X, Y, X1, Y1, strokeColor, fillColor);

            _elements.Add(objRectangle);
            objRectangle = null;
        }
Exemple #7
0
        /// <summary>
        /// Method that adds a rectangle to the page object
        /// </summary>
        /// <param name="X">X position of the rectangle in the page</param>
        /// <param name="Y">Y position of the rectangle in the page</param>
        /// <param name="X1">X1 position of the rectangle in the page</param>
        /// <param name="Y1">Y1 position of the rectangle in the page</param>
        /// <param name="strokeColor">Border's color</param>
        /// <param name="fillColor">Rectancle's color</param>
        /// <param name="borderWidth">Border's size</param>
        /// <param name="borderStyle">Border's style</param>
        public void drawRectangle(int X, int Y, int X1, int Y1, predefinedColor strokeColor, predefinedColor fillColor, int borderWidth, predefinedLineStyle borderStyle)
        {
            rectangleElement objRectangle = new rectangleElement(X, Y, X1, Y1, strokeColor, fillColor, borderWidth, borderStyle);

            _elements.Add(objRectangle);
            objRectangle = null;
        }
Exemple #8
0
        /// <summary>
        /// Method that adds a circle to the page object
        /// </summary>
        /// <param name="X">X position of the circle in the page</param>
        /// <param name="Y">Y position of the circle in the page</param>
        /// <param name="ray">Circle's ray</param>
        /// <param name="strokeColor">Border's color</param>
        /// <param name="fillColor">Circle's color</param>
        public void drawCircle(int X, int Y, int ray, predefinedColor strokeColor, predefinedColor fillColor)
        {
            circleElement objCircle = new circleElement(X, Y, ray, strokeColor, fillColor);

            _elements.Add(objCircle);
            objCircle = null;
        }
Exemple #9
0
        /// <summary>
        /// Method that adds a circle to the page object
        /// </summary>
        /// <param name="X">X position of the circle in the page</param>
        /// <param name="Y">Y position of the circle in the page</param>
        /// <param name="ray">Circle's ray</param>
        /// <param name="strokeColor">Border's color</param>
        /// <param name="fillColor">Circle's color</param>
        /// <param name="borderStyle">Border's style</param>
        /// <param name="borderWidth">Border's size</param>
        public void drawCircle(int X, int Y, int ray, predefinedColor strokeColor, predefinedColor fillColor, predefinedLineStyle borderStyle, int borderWidth)
        {
            circleElement objCircle = new circleElement(X, Y, ray, strokeColor, fillColor, borderWidth, borderStyle);

            _elements.Add(objCircle);
            objCircle = null;
        }
Exemple #10
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 public pdfTableRowStyle(predefinedFont fontType, int fontSize, predefinedColor fontColor, predefinedColor bgColor)
 {
     _fontType = fontType;
     _fontSize = fontSize;
     _fontColor = new pdfColor(fontColor);
     _bgColor = new pdfColor(bgColor);
 }
 /// <summary>
 /// Class's constructor [DEPRECATED]
 /// </summary>
 /// <param name="newContent">Text of the paragraph</param>
 /// <param name="newFontSize">Font's size</param>
 /// <param name="newFontType">Font's type</param>
 /// <param name="newCoordX">X position in the PDF document</param>
 /// <param name="newCoordY">Y position in the PDF document</param>
 /// <param name="newStrokeColor">Font's color</param>
 public paragraphElement(IEnumerable newContent, int newFontSize, predefinedFont newFontType, int newCoordX, int newCoordY, predefinedColor newStrokeColor)
 {
     _content = newContent;
     _fontSize = newFontSize;
     _fontType = newFontType;
     _coordX = newCoordX;
     _coordY = newCoordY;
     _strokeColor = new pdfColor(newStrokeColor);
 }
Exemple #12
0
 /// <summary>
 /// Class's constructor [DEPRECATED]
 /// </summary>
 /// <param name="X">X position in the PDF document</param>
 /// <param name="Y">Y position in the PDF document</param>
 /// <param name="Ray">Ray of the circle</param>
 /// <param name="strokeColor">Color of circle's border</param>
 /// <param name="fillColor">Color of the circle</param>
 /// <param name="newStyle">Border's style</param>
 public circleElement(int X, int Y, int Ray, predefinedColor strokeColor, predefinedColor fillColor, predefinedLineStyle newStyle)
 {
     _coordX      = X;
     _coordY      = Y;
     _ray         = Ray;
     _strokeColor = new pdfColor(strokeColor);
     _fillColor   = new pdfColor(fillColor);
     _lineStyle   = new pdfLineStyle(1, newStyle);
 }
Exemple #13
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="X">X position in the PDF document</param>
 /// <param name="Y">Y position in the PDF document</param>
 /// <param name="Ray">Ray of the circle</param>
 /// <param name="strokeColor">Color of circle's border</param>
 /// <param name="fillColor">Color of the circle</param>
 /// <param name="newStyle">Border's style</param>
 public circleElement(int X, int Y, int Ray, predefinedColor strokeColor, predefinedColor fillColor, predefinedLineStyle newStyle)
 {
     _coordX = X;
     _coordY = Y;
     _ray = Ray;
     _strokeColor = new pdfColor(strokeColor);
     _fillColor = new pdfColor(fillColor);
     _lineStyle = new pdfLineStyle(1, newStyle);
 }
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="newContent">Text's content</param>
 /// <param name="newFontSize">Font's size</param>
 /// <param name="newFontType">Font's type</param>
 /// <param name="newCoordX">X position of the text in the page</param>
 /// <param name="newCoordY">Y position of the text in the page</param>
 /// <param name="newStrokeColor">Font's color</param>
 public textElement(string newContent, int newFontSize, predefinedFont newFontType, int newCoordX, int newCoordY, predefinedColor newStrokeColor)
 {
     _content = newContent;
     _fontSize = newFontSize;
     _fontType = newFontType;
     _coordX = newCoordX;
     _coordY = newCoordY;
     _strokeColor = new pdfColor(newStrokeColor);
 }
Exemple #15
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="X">X position in the PDF document</param>
 /// <param name="Y">Y position in the PDF document</param>
 /// <param name="X1">X1 position in the PDF document</param>
 /// <param name="Y1">Y1 position in the PDF document</param>
 /// <param name="newColor">Line's color</param>
 public lineElement(int X, int Y, int X1, int Y1, predefinedColor newColor)
 {
     _coordX      = X;
     _coordY      = Y;
     _coordX1     = X1;
     _coordY1     = Y1;
     _strokeColor = new pdfColor(newColor);
     _lineStyle   = new pdfLineStyle(1, predefinedLineStyle.csNormal);
 }
Exemple #16
0
 /// <summary>
 /// Class's constructor [DEPRECATED]
 /// </summary>
 /// <param name="X">X position in the PDF document</param>
 /// <param name="Y">Y position in the PDF document</param>
 /// <param name="Ray">Ray of the circle</param>
 /// <param name="strokeColor">Color of circle's border</param>
 /// <param name="fillColor">Color of the circle</param>
 /// <param name="newWidth">Border's size</param>
 public circleElement(int X, int Y, int Ray, predefinedColor strokeColor, predefinedColor fillColor, int newWidth)
 {
     _coordX      = X;
     _coordY      = Y;
     _ray         = Ray;
     _strokeColor = new pdfColor(strokeColor);
     _fillColor   = new pdfColor(fillColor);
     _lineStyle   = new pdfLineStyle(newWidth, predefinedLineStyle.csNormal);
 }
Exemple #17
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="X">X position in the PDF document</param>
 /// <param name="Y">Y position in the PDF document</param>
 /// <param name="Ray">Ray of the circle</param>
 /// <param name="strokeColor">Color of circle's border</param>
 /// <param name="fillColor">Color of the circle</param>
 /// <param name="newWidth">Border's size</param>
 public circleElement(int X, int Y, int Ray, predefinedColor strokeColor, predefinedColor fillColor, int newWidth)
 {
     _coordX = X;
     _coordY = Y;
     _ray = Ray;
     _strokeColor = new pdfColor(strokeColor);
     _fillColor = new pdfColor(fillColor);
     _lineStyle = new pdfLineStyle(newWidth, predefinedLineStyle.csNormal);
 }
Exemple #18
0
 /// <summary>
 /// Method that adds a rectangle to the page object
 /// </summary>
 /// <param name="X">X position of the rectangle in the page</param>
 /// <param name="Y">Y position of the rectangle in the page</param>
 /// <param name="X1">X1 position of the rectangle in the page</param>
 /// <param name="Y1">Y1 position of the rectangle in the page</param>
 /// <param name="strokeColor">Border's color</param>
 /// <param name="fillColor">Rectancle's color</param>
 /// <param name="newStyle">Border's style</param>
 public rectangleElement(int X, int Y, int X1, int Y1, predefinedColor strokeColor, predefinedColor fillColor, predefinedLineStyle newStyle)
 {
     _coordX = X;
     _coordY = Y;
     _coordX1 = X1;
     _coordY1 = Y1;
     _strokeColor = new pdfColor(strokeColor);
     _fillColor = new pdfColor(fillColor);
     _lineStyle = new pdfLineStyle(1, newStyle);
 }
Exemple #19
0
 /// <summary>
 /// Method that adds a rectangle to the page object
 /// </summary>
 /// <param name="X">X position of the rectangle in the page</param>
 /// <param name="Y">Y position of the rectangle in the page</param>
 /// <param name="X1">X1 position of the rectangle in the page</param>
 /// <param name="Y1">Y1 position of the rectangle in the page</param>
 /// <param name="strokeColor">Border's color</param>
 /// <param name="fillColor">Rectancle's color</param>
 /// <param name="newWidth">Border's width</param>
 public rectangleElement(int X, int Y, int X1, int Y1, predefinedColor strokeColor, predefinedColor fillColor, int newWidth)
 {
     _coordX = X;
     _coordY = Y;
     _coordX1 = X1;
     _coordY1 = Y1;
     _strokeColor = new pdfColor(strokeColor);
     _fillColor = new pdfColor(fillColor);
     _lineStyle = new pdfLineStyle(newWidth, predefinedLineStyle.csNormal);
 }
 /// <summary>
 /// Method that adds a rectangle to the page object [DEPRECATED]
 /// </summary>
 /// <param name="X">X position of the rectangle in the page</param>
 /// <param name="Y">Y position of the rectangle in the page</param>
 /// <param name="X1">X1 position of the rectangle in the page</param>
 /// <param name="Y1">Y1 position of the rectangle in the page</param>
 /// <param name="strokeColor">Border's color</param>
 /// <param name="fillColor">Rectancle's color</param>
 /// <param name="newStyle">Border's style</param>
 public rectangleElement(int X, int Y, int X1, int Y1, predefinedColor strokeColor, predefinedColor fillColor, predefinedLineStyle newStyle)
 {
     _coordX      = X;
     _coordY      = Y;
     _coordX1     = X1;
     _coordY1     = Y1;
     _strokeColor = new pdfColor(strokeColor);
     _fillColor   = new pdfColor(fillColor);
     _lineStyle   = new pdfLineStyle(1, newStyle);
 }
 /// <summary>
 /// Method that adds a rectangle to the page object [DEPRECATED]
 /// </summary>
 /// <param name="X">X position of the rectangle in the page</param>
 /// <param name="Y">Y position of the rectangle in the page</param>
 /// <param name="X1">X1 position of the rectangle in the page</param>
 /// <param name="Y1">Y1 position of the rectangle in the page</param>
 /// <param name="strokeColor">Border's color</param>
 /// <param name="fillColor">Rectancle's color</param>
 /// <param name="newWidth">Border's width</param>
 public rectangleElement(int X, int Y, int X1, int Y1, predefinedColor strokeColor, predefinedColor fillColor, int newWidth)
 {
     _coordX      = X;
     _coordY      = Y;
     _coordX1     = X1;
     _coordY1     = Y1;
     _strokeColor = new pdfColor(strokeColor);
     _fillColor   = new pdfColor(fillColor);
     _lineStyle   = new pdfLineStyle(newWidth, predefinedLineStyle.csNormal);
 }
Exemple #22
0
        /// <summary>
        /// Class's constructor
        /// </summary>
        /// <param name="newColor">Color</param>
        public pdfColor(predefinedColor newColor)
        {
            switch (newColor)
            {
            case predefinedColor.csNoColor:
                _rColor = "";
                _gColor = "";
                _bColor = "";
                break;

            case predefinedColor.csBlack:
                _rColor = "0";
                _gColor = "0";
                _bColor = "0";
                break;

            case predefinedColor.csWhite:
                _rColor = "1";
                _gColor = "1";
                _bColor = "1";
                break;

            case predefinedColor.csRed:
                _rColor = "1";
                _gColor = "0";
                _bColor = "0";
                break;

            case predefinedColor.csLightRed:
                _rColor = "1";
                _gColor = ".75";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkRed:
                _rColor = ".5";
                _gColor = "0";
                _bColor = "0";
                break;

            case predefinedColor.csOrange:
                _rColor = "1";
                _gColor = ".5";
                _bColor = "0";
                break;

            case predefinedColor.csLightOrange:
                _rColor = "1";
                _gColor = ".75";
                _bColor = "0";
                break;

            case predefinedColor.csDarkOrange:
                _rColor = "1";
                _gColor = ".25";
                _bColor = "0";
                break;

            case predefinedColor.csYellow:
                _rColor = "1";
                _gColor = "1";
                _bColor = ".25";
                break;

            case predefinedColor.csLightYellow:
                _rColor = "1";
                _gColor = "1";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkYellow:
                _rColor = "1";
                _gColor = "1";
                _bColor = "0";
                break;

            case predefinedColor.csBlue:
                _rColor = "0";
                _gColor = "0";
                _bColor = "1";
                break;

            case predefinedColor.csLightBlue:
                _rColor = ".1";
                _gColor = ".3";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkBlue:
                _rColor = "0";
                _gColor = "0";
                _bColor = ".5";
                break;

            case predefinedColor.csGreen:
                _rColor = "0";
                _gColor = "1";
                _bColor = "0";
                break;

            case predefinedColor.csLightGreen:
                _rColor = ".75";
                _gColor = "1";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkGreen:
                _rColor = "0";
                _gColor = ".5";
                _bColor = "0";
                break;

            case predefinedColor.csCyan:
                _rColor = "0";
                _gColor = ".5";
                _bColor = "1";
                break;

            case predefinedColor.csLightCyan:
                _rColor = ".2";
                _gColor = ".8";
                _bColor = "1";
                break;

            case predefinedColor.csDarkCyan:
                _rColor = "0";
                _gColor = ".4";
                _bColor = ".8";
                break;

            case predefinedColor.csPurple:
                _rColor = ".5";
                _gColor = "0";
                _bColor = "1";
                break;

            case predefinedColor.csLightPurple:
                _rColor = ".75";
                _gColor = ".45";
                _bColor = ".95";
                break;

            case predefinedColor.csDarkPurple:
                _rColor = ".4";
                _gColor = ".1";
                _bColor = ".5";
                break;

            case predefinedColor.csGray:
                _rColor = ".5";
                _gColor = ".5";
                _bColor = ".5";
                break;

            case predefinedColor.csLightGray:
                _rColor = ".75";
                _gColor = ".75";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkGray:
                _rColor = ".25";
                _gColor = ".25";
                _bColor = ".25";
                break;

            case predefinedColor.csBagoHeader:
                _rColor = "0.6313726";
                _gColor = "0.2745098";
                _bColor = "0.6078432";
                break;

            case predefinedColor.csBagoAlternateRow:
                _rColor = "0.9056604";
                _gColor = "0.4400143";
                _bColor = "0.8749584";
                break;
            }
            _color = newColor;
        }
Exemple #23
0
        /// <summary>
        /// Method that adds a paragraph to the page object [DEPRECATED]
        /// </summary>
        /// <param name="newText">Text</param>
        /// <param name="x">X position of the text in the page</param>
        /// <param name="y">Y position of the text in the page</param>
        /// <param name="fontType">Font's type</param>
        /// <param name="fontSize">Font's size</param>
        /// <param name="parWidth">Paragraph's width</param>
        /// <param name="fontColor">Font's color</param>
        public void addParagraph(string newText, int x, int y, predefinedFont fontType, int fontSize, int parWidth, predefinedColor fontColor)
        {
            paragraphElement objParagraph = new paragraphElement(textAdapter.formatParagraph(newText, fontSize, fontType, parWidth), fontSize, fontType, x, y, fontColor);

            _persistentElements.Add(objParagraph);
            objParagraph = null;
        }
Exemple #24
0
 /// <summary>
 /// Class's constructor [DEPRECATED]
 /// </summary>
 /// <param name="newContent">Text of the paragraph</param>
 /// <param name="newFontSize">Font's size</param>
 /// <param name="newFontType">Font's type</param>
 /// <param name="newCoordX">X position in the PDF document</param>
 /// <param name="newCoordY">Y position in the PDF document</param>
 /// <param name="newStrokeColor">Font's color</param>
 public paragraphElement(IEnumerable newContent, int newFontSize, predefinedFont newFontType, int newCoordX, int newCoordY, predefinedColor newStrokeColor)
 {
     _content     = newContent;
     _fontSize    = newFontSize;
     _fontType    = newFontType;
     _coordX      = newCoordX;
     _coordY      = newCoordY;
     _strokeColor = new pdfColor(newStrokeColor);
 }
Exemple #25
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="newContent">Text's content</param>
 /// <param name="newFontSize">Font's size</param>
 /// <param name="newFontType">Font's type</param>
 /// <param name="newCoordX">X position of the text in the page</param>
 /// <param name="newCoordY">Y position of the text in the page</param>
 /// <param name="newStrokeColor">Font's color</param>
 public textElement(string newContent, int newFontSize, predefinedFont newFontType, int newCoordX, int newCoordY, predefinedColor newStrokeColor)
 {
     _content     = newContent;
     _fontSize    = newFontSize;
     _fontType    = newFontType;
     _coordX      = newCoordX;
     _coordY      = newCoordY;
     _strokeColor = new pdfColor(newStrokeColor);
 }
Exemple #26
0
 /// <summary>
 /// Method that adds a paragraph to the page object
 /// </summary>
 /// <param name="newText">Interface IEnumerable that contains paragraphLine objects</param>
 /// <param name="x">X position of the text in the page</param>
 /// <param name="y">Y position of the text in the page</param>
 /// <param name="fontType">Font's type</param>
 /// <param name="fontSize">Font's size</param>
 /// <param name="fontColor">Font's color</param>
 public void addParagraph(IEnumerable newText, int x, int y, predefinedFont fontType, int fontSize, predefinedColor fontColor)
 {
     try {
         paragraphElement objParagraph = new paragraphElement(newText, fontSize, fontType, x, y, fontColor);
         _elements.Add(objParagraph);
         objParagraph = null;
     } catch (pdfIncorrectParagraghException ex) {
         throw new pdfIncorrectParagraghException();
     }
 }
Exemple #27
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="newColor">Color</param>
 public pdfColor(predefinedColor newColor)
 {
     switch (newColor)
     {
         case predefinedColor.csNoColor:
             _rColor = "";
             _gColor = "";
             _bColor = "";
             break;
         case predefinedColor.csBlack:
             _rColor = "0";
             _gColor = "0";
             _bColor = "0";
             break;
         case predefinedColor.csWhite:
             _rColor = "1";
             _gColor = "1";
             _bColor = "1";
             break;
         case predefinedColor.csRed:
             _rColor = "1";
             _gColor = "0";
             _bColor = "0";
             break;
         case predefinedColor.csLightRed:
             _rColor = "1";
             _gColor = ".75";
             _bColor = ".75";
             break;
         case predefinedColor.csDarkRed:
             _rColor = ".5";
             _gColor = "0";
             _bColor = "0";
             break;
         case predefinedColor.csOrange:
             _rColor = "1";
             _gColor = ".5";
             _bColor = "0";
             break;
         case predefinedColor.csLightOrange:
             _rColor = "1";
             _gColor = ".75";
             _bColor = "0";
             break;
         case predefinedColor.csDarkOrange:
             _rColor = "1";
             _gColor = ".25";
             _bColor = "0";
             break;
         case predefinedColor.csYellow:
             _rColor = "1";
             _gColor = "1";
             _bColor = ".25";
             break;
         case predefinedColor.csLightYellow:
             _rColor = "1";
             _gColor = "1";
             _bColor = ".75";
             break;
         case predefinedColor.csDarkYellow:
             _rColor = "1";
             _gColor = "1";
             _bColor = "0";
             break;
         case predefinedColor.csBlue:
             _rColor = "0";
             _gColor = "0";
             _bColor = "1";
             break;
         case predefinedColor.csLightBlue:
             _rColor = ".1";
             _gColor = ".3";
             _bColor = ".75";
             break;
         case predefinedColor.csDarkBlue:
             _rColor = "0";
             _gColor = "0";
             _bColor = ".5";
             break;
         case predefinedColor.csGreen:
             _rColor = "0";
             _gColor = "1";
             _bColor = "0";
             break;
         case predefinedColor.csLightGreen:
             _rColor = ".75";
             _gColor = "1";
             _bColor = ".75";
             break;
         case predefinedColor.csDarkGreen:
             _rColor = "0";
             _gColor = ".5";
             _bColor = "0";
             break;
         case predefinedColor.csCyan:
             _rColor = "0";
             _gColor = ".5";
             _bColor = "1";
             break;
         case predefinedColor.csLightCyan:
             _rColor = ".2";
             _gColor = ".8";
             _bColor = "1";
             break;
         case predefinedColor.csDarkCyan:
             _rColor = "0";
             _gColor = ".4";
             _bColor = ".8";
             break;
         case predefinedColor.csPurple:
             _rColor = ".5";
             _gColor = "0";
             _bColor = "1";
             break;
         case predefinedColor.csLightPurple:
             _rColor = ".75";
             _gColor = ".45";
             _bColor = ".95";
             break;
         case predefinedColor.csDarkPurple:
             _rColor = ".4";
             _gColor = ".1";
             _bColor = ".5";
             break;
         case predefinedColor.csGray:
             _rColor = ".5";
             _gColor = ".5";
             _bColor = ".5";
             break;
         case predefinedColor.csLightGray:
             _rColor = ".75";
             _gColor = ".75";
             _bColor = ".75";
             break;
         case predefinedColor.csDarkGray:
             _rColor = ".25";
             _gColor = ".25";
             _bColor = ".25";
             break;
     }
     _color = newColor;
 }
Exemple #28
0
 /// <summary>
 /// Method that adds a line to the page object
 /// </summary>
 /// <param name="X">X position of the line in the page</param>
 /// <param name="Y">Y position of the line in the page</param>
 /// <param name="X1">X1 position of the line in the page</param>
 /// <param name="Y1">Y1 position of the line in the page</param>
 /// <param name="lineStyle">Line's style</param>
 /// <param name="lineColor">Line's color</param>
 /// <param name="lineWidth">Line's size</param>
 public void drawLine(int X, int Y, int X1, int Y1, predefinedLineStyle lineStyle, predefinedColor lineColor, int lineWidth)
 {
     lineElement objLine = new lineElement(X, Y, X1, Y1, lineWidth, lineStyle, lineColor);
     _elements.Add(objLine);
     objLine = null;
 }
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="rColor">Red component of the color</param>
 /// <param name="gColor">Green component of the color</param>
 /// <param name="bColor">Blue component of the color</param>
 public pdfColor(int rColor, int gColor, int bColor)
 {
     _rColor = formatColorComponent(rColor);
     _gColor = formatColorComponent(gColor);
     _bColor = formatColorComponent(bColor);
     _color = predefinedColor.csUserColor;
 }
Exemple #30
0
 /// <summary>
 /// Method that adds a rectangle to the page object
 /// </summary>
 /// <param name="X">X position of the rectangle in the page</param>
 /// <param name="Y">Y position of the rectangle in the page</param>
 /// <param name="X1">X1 position of the rectangle in the page</param>
 /// <param name="Y1">Y1 position of the rectangle in the page</param>
 /// <param name="strokeColor">Border's color</param>
 /// <param name="fillColor">Rectancle's color</param>
 public void drawRectangle(int X, int Y, int X1, int Y1, predefinedColor strokeColor, predefinedColor fillColor)
 {
     rectangleElement objRectangle = new rectangleElement(X, Y, X1, Y1, strokeColor, fillColor);
     _elements.Add(objRectangle);
     objRectangle = null;
 }
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="HEXColor">Hex Color</param>
 public pdfColor(string HEXColor)
 {
     _rColor = formatColorComponent(int.Parse(HEXColor.Substring(0,2), System.Globalization.NumberStyles.HexNumber));
     _gColor = formatColorComponent(int.Parse(HEXColor.Substring(2,2), System.Globalization.NumberStyles.HexNumber));
     _bColor = formatColorComponent(int.Parse(HEXColor.Substring(4,2), System.Globalization.NumberStyles.HexNumber));
     _color = predefinedColor.csUserColor;
 }
 /// <summary>
 /// Method that adds a line to the page object [DEPRECATED]
 /// </summary>
 /// <param name="X">X position of the line in the page</param>
 /// <param name="Y">Y position of the line in the page</param>
 /// <param name="X1">X1 position of the line in the page</param>
 /// <param name="Y1">Y1 position of the line in the page</param>
 /// <param name="lineColor">Line's color</param>
 public void drawLine(int X, int Y, int X1, int Y1, predefinedColor lineColor)
 {
     lineElement objLine = new lineElement(X, Y, X1, Y1, lineColor);
     _persistentElements.Add(objLine);
     objLine = null;
 }
        /// <summary>
        /// Class's constructor
        /// </summary>
        /// <param name="newColor">Color</param>
        public pdfColor(predefinedColor newColor)
        {
            switch (newColor)
            {
            case predefinedColor.csNoColor:
                _rColor = "";
                _gColor = "";
                _bColor = "";
                break;

            case predefinedColor.csBlack:
                _rColor = "0";
                _gColor = "0";
                _bColor = "0";
                break;

            case predefinedColor.csWhite:
                _rColor = "1";
                _gColor = "1";
                _bColor = "1";
                break;

            case predefinedColor.csRed:
                _rColor = "1";
                _gColor = "0";
                _bColor = "0";
                break;

            case predefinedColor.csLightRed:
                _rColor = "1";
                _gColor = ".75";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkRed:
                _rColor = ".5";
                _gColor = "0";
                _bColor = "0";
                break;

            case predefinedColor.csOrange:
                _rColor = "1";
                _gColor = ".5";
                _bColor = "0";
                break;

            case predefinedColor.csLightOrange:
                _rColor = "1";
                _gColor = ".75";
                _bColor = "0";
                break;

            case predefinedColor.csDarkOrange:
                _rColor = "1";
                _gColor = ".25";
                _bColor = "0";
                break;

            case predefinedColor.csYellow:
                _rColor = "1";
                _gColor = "1";
                _bColor = ".25";
                break;

            case predefinedColor.csLightYellow:
                _rColor = "1";
                _gColor = "1";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkYellow:
                _rColor = "1";
                _gColor = "1";
                _bColor = "0";
                break;

            case predefinedColor.csBlue:
                _rColor = "0";
                _gColor = "0";
                _bColor = "1";
                break;

            case predefinedColor.csLightBlue:
                _rColor = ".1";
                _gColor = ".3";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkBlue:
                _rColor = "0";
                _gColor = "0";
                _bColor = ".5";
                break;

            case predefinedColor.csGreen:
                _rColor = "0";
                _gColor = "1";
                _bColor = "0";
                break;

            case predefinedColor.csLightGreen:
                _rColor = ".75";
                _gColor = "1";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkGreen:
                _rColor = "0";
                _gColor = ".5";
                _bColor = "0";
                break;

            case predefinedColor.csCyan:
                _rColor = "0";
                _gColor = ".5";
                _bColor = "1";
                break;

            case predefinedColor.csLightCyan:
                _rColor = ".2";
                _gColor = ".8";
                _bColor = "1";
                break;

            case predefinedColor.csDarkCyan:
                _rColor = "0";
                _gColor = ".4";
                _bColor = ".8";
                break;

            case predefinedColor.csPurple:
                _rColor = ".5";
                _gColor = "0";
                _bColor = "1";
                break;

            case predefinedColor.csLightPurple:
                _rColor = ".75";
                _gColor = ".45";
                _bColor = ".95";
                break;

            case predefinedColor.csDarkPurple:
                _rColor = ".4";
                _gColor = ".1";
                _bColor = ".5";
                break;

            case predefinedColor.csGray:
                _rColor = ".5";
                _gColor = ".5";
                _bColor = ".5";
                break;

            case predefinedColor.csLightGray:
                _rColor = ".75";
                _gColor = ".75";
                _bColor = ".75";
                break;

            case predefinedColor.csDarkGray:
                _rColor = ".25";
                _gColor = ".25";
                _bColor = ".25";
                break;
            }
            _color = newColor;
        }
Exemple #34
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="X">X position in the PDF document</param>
 /// <param name="Y">Y position in the PDF document</param>
 /// <param name="X1">X1 position in the PDF document</param>
 /// <param name="Y1">Y1 position in the PDF document</param>	
 /// <param name="newWidth">Line's size</param>
 /// <param name="newStyle">Line's style</param>
 /// <param name="newColor">Line's color</param>
 public lineElement(int X, int Y, int X1, int Y1, int newWidth, predefinedLineStyle newStyle, predefinedColor newColor)
 {
     _coordX = X;
     _coordY = Y;
     _coordX1 = X1;
     _coordY1 = Y1;
     _strokeColor = new pdfColor(newColor);
     _lineStyle = new pdfLineStyle(newWidth, newStyle);
 }
Exemple #35
0
 /// <summary>
 /// Method that adds a paragraph to the page object
 /// </summary>
 /// <param name="newText">Interface IEnumerable that contains paragraphLine objects</param>
 /// <param name="x">X position of the text in the page</param>
 /// <param name="y">Y position of the text in the page</param>
 /// <param name="fontType">Font's type</param>
 /// <param name="fontSize">Font's size</param>
 /// <param name="fontColor">Font's color</param>
 public void addParagraph(IEnumerable newText, int x, int y, predefinedFont fontType, int fontSize, predefinedColor fontColor)
 {
     try {
     paragraphElement objParagraph = new paragraphElement(newText, fontSize, fontType, x, y, fontColor);
     _elements.Add(objParagraph);
     objParagraph = null;
     } catch (pdfIncorrectParagraghException ex) {
         throw new pdfIncorrectParagraghException();
     }
 }
Exemple #36
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="X">X position in the PDF document</param>
 /// <param name="Y">Y position in the PDF document</param>
 /// <param name="X1">X1 position in the PDF document</param>
 /// <param name="Y1">Y1 position in the PDF document</param>	
 /// <param name="newColor">Line's color</param>
 public lineElement(int X, int Y, int X1, int Y1, predefinedColor newColor)
 {
     _coordX = X;
     _coordY = Y;
     _coordX1 = X1;
     _coordY1 = Y1;
     _strokeColor = new pdfColor(newColor);
     _lineStyle = new pdfLineStyle(1,predefinedLineStyle.csNormal);
 }
Exemple #37
0
 /// <summary>
 /// Method that adds a rectangle to the page object
 /// </summary>
 /// <param name="X">X position of the rectangle in the page</param>
 /// <param name="Y">Y position of the rectangle in the page</param>
 /// <param name="X1">X1 position of the rectangle in the page</param>
 /// <param name="Y1">Y1 position of the rectangle in the page</param>
 /// <param name="strokeColor">Border's color</param>
 /// <param name="fillColor">Rectancle's color</param>
 /// <param name="borderWidth">Border's size</param>
 /// <param name="borderStyle">Border's style</param>
 public void drawRectangle(int X, int Y, int X1, int Y1, predefinedColor strokeColor, predefinedColor fillColor, int borderWidth, predefinedLineStyle borderStyle)
 {
     rectangleElement objRectangle = new rectangleElement(X, Y, X1, Y1, strokeColor, fillColor, borderWidth, borderStyle);
     _elements.Add(objRectangle);
     objRectangle = null;
 }
Exemple #38
0
 /// <summary>
 /// Method that adds a circle to the page object
 /// </summary>
 /// <param name="X">X position of the circle in the page</param>
 /// <param name="Y">Y position of the circle in the page</param>
 /// <param name="ray">Circle's ray</param>
 /// <param name="strokeColor">Border's color</param>
 /// <param name="fillColor">Circle's color</param>
 public void drawCircle(int X, int Y, int ray, predefinedColor strokeColor, predefinedColor fillColor)
 {
     circleElement objCircle = new circleElement(X, Y, ray, strokeColor, fillColor);
     _elements.Add(objCircle);
     objCircle = null;
 }
Exemple #39
0
 /// <summary>
 /// Method that adds a circle to the page object
 /// </summary>
 /// <param name="X">X position of the circle in the page</param>
 /// <param name="Y">Y position of the circle in the page</param>
 /// <param name="ray">Circle's ray</param>
 /// <param name="strokeColor">Border's color</param>
 /// <param name="fillColor">Circle's color</param>
 /// <param name="borderStyle">Border's style</param>
 /// <param name="borderWidth">Border's size</param>
 public void drawCircle(int X, int Y, int ray, predefinedColor strokeColor, predefinedColor fillColor, predefinedLineStyle borderStyle, int borderWidth)
 {
     circleElement objCircle = new circleElement(X, Y, ray, strokeColor, fillColor, borderWidth, borderStyle);
     _elements.Add(objCircle);
     objCircle = null;
 }
Exemple #40
0
 /// <summary>
 /// Class's constructor
 /// </summary>
 /// <param name="X">X position in the PDF document</param>
 /// <param name="Y">Y position in the PDF document</param>
 /// <param name="X1">X1 position in the PDF document</param>
 /// <param name="Y1">Y1 position in the PDF document</param>
 /// <param name="newWidth">Line's size</param>
 /// <param name="newStyle">Line's style</param>
 /// <param name="newColor">Line's color</param>
 public lineElement(int X, int Y, int X1, int Y1, int newWidth, predefinedLineStyle newStyle, predefinedColor newColor)
 {
     _coordX      = X;
     _coordY      = Y;
     _coordX1     = X1;
     _coordY1     = Y1;
     _strokeColor = new pdfColor(newColor);
     _lineStyle   = new pdfLineStyle(newWidth, newStyle);
 }
Exemple #41
0
 /// <summary>
 /// Method that adds a text element to the page object
 /// </summary>
 /// <param name="newText">Text</param>
 /// <param name="X">X position of the text in the page</param>
 /// <param name="Y">Y position of the text in the page</param>
 /// <param name="fontType">Font's type</param>
 /// <param name="fontSize">Font's size</param>
 /// <param name="fontColor">Font's color</param>
 public void addText(string newText, int X, int Y, predefinedFont fontType, int fontSize, predefinedColor fontColor)
 {
     textElement objText = new textElement(newText, fontSize, fontType, X, Y, fontColor);
     _elements.Add(objText);
     objText = null;
 }
Exemple #42
0
        /// <summary>
        /// Method that adds a text element to the page object
        /// </summary>
        /// <param name="newText">Text</param>
        /// <param name="X">X position of the text in the page</param>
        /// <param name="Y">Y position of the text in the page</param>
        /// <param name="fontType">Font's type</param>
        /// <param name="fontSize">Font's size</param>
        /// <param name="fontColor">Font's color</param>
        public void addText(string newText, int X, int Y, predefinedFont fontType, int fontSize, predefinedColor fontColor)
        {
            textElement objText = new textElement(newText, fontSize, fontType, X, Y, fontColor);

            _elements.Add(objText);
            objText = null;
        }
Exemple #43
0
        /// <summary>
        /// Method that adds a paragraph to the page object
        /// </summary>
        /// <param name="newText">Text</param>
        /// <param name="x">X position of the text in the page</param>
        /// <param name="y">Y position of the text in the page</param>
        /// <param name="fontType">Font's type</param>
        /// <param name="fontSize">Font's size</param>
        /// <param name="parWidth">Paragraph's width</param>
        /// <param name="lineHeight">Line's height</param>
        /// <param name="parAlign">Paragraph's alignment</param>
        /// <param name="fontColor">Font's color</param>
        public void addParagraph(string newText, int x, int y, predefinedFont fontType, int fontSize, int parWidth, int lineHeight, predefinedAlignment parAlign, predefinedColor fontColor)
        {
            paragraphElement objParagraph = new paragraphElement(textAdapter.formatParagraph(newText, fontSize, fontType, parWidth, lineHeight, parAlign), fontSize, fontType, x, y, fontColor);

            _elements.Add(objParagraph);
            objParagraph = null;
        }
 /// <summary>
 /// Method that adds a paragraph to the page object [DEPRECATED]
 /// </summary>
 /// <param name="newText">Text</param>
 /// <param name="x">X position of the text in the page</param>
 /// <param name="y">Y position of the text in the page</param>
 /// <param name="fontType">Font's type</param>
 /// <param name="fontSize">Font's size</param>
 /// <param name="parWidth">Paragraph's width</param>
 /// <param name="fontColor">Font's color</param>
 public void addParagraph(string newText, int x, int y, predefinedFont fontType, int fontSize, int parWidth, predefinedColor fontColor)
 {
     paragraphElement objParagraph = new paragraphElement(textAdapter.formatParagraph(newText, fontSize, fontType, parWidth), fontSize, fontType, x, y, fontColor);
     _persistentElements.Add(objParagraph);
     objParagraph = null;
 }
Exemple #45
0
 /// <summary>
 /// Method that adds a paragraph to the page object
 /// </summary>
 /// <param name="newText">Text</param>
 /// <param name="x">X position of the text in the page</param>
 /// <param name="y">Y position of the text in the page</param>
 /// <param name="fontType">Font's type</param>
 /// <param name="fontSize">Font's size</param>
 /// <param name="parWidth">Paragraph's width</param>
 /// <param name="lineHeight">Line's height</param>
 /// <param name="parAlign">Paragraph's alignment</param>
 /// <param name="fontColor">Font's color</param>
 public void addParagraph(string newText, int x, int y, predefinedFont fontType, int fontSize, int parWidth, int lineHeight, predefinedAlignment parAlign, predefinedColor fontColor)
 {
     paragraphElement objParagraph = new paragraphElement(textAdapter.formatParagraph(newText, fontSize, fontType, parWidth, lineHeight, parAlign), fontSize, fontType, x, y, fontColor);
     _elements.Add(objParagraph);
     objParagraph = null;
 }