/// <summary> /// Class's constructor /// </summary> public pdfTableRowStyle(predefinedFont fontType, int fontSize, pdfColor fontColor, pdfColor bgColor) { _fontType = fontType; _fontSize = fontSize; _fontColor = fontColor; _bgColor = bgColor; }
/// <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; }
/// <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> /// 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 /// </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> public void addParagraph(string newText, int x, int y, predefinedFont fontType, int fontSize, int parWidth) { paragraphElement objParagraph = new paragraphElement(textAdapter.formatParagraph(newText, fontSize, fontType, parWidth), fontSize, fontType, x, y); _elements.Add(objParagraph); objParagraph = null; }
/// <summary> /// Static Mehtod that returns the name of the font /// </summary> /// <param name="fontType">Font's Type</param> /// <returns>String that contains the name of the font</returns> public static string getFontName(predefinedFont fontType) { switch (fontType) { case predefinedFont.csHelvetica: return "Helvetica"; case predefinedFont.csHelveticaBold: return "Helvetica-Bold"; case predefinedFont.csHelveticaOblique: return "Helvetica-Oblique"; case predefinedFont.csHelvetivaBoldOblique: return "Helvetica-BoldOblique"; case predefinedFont.csCourier: return "Courier"; case predefinedFont.csCourierBold: return "Courier-Bold"; case predefinedFont.csCourierOblique: return "Courier-Oblique"; case predefinedFont.csCourierBoldOblique: return "Courier-BoldOblique"; case predefinedFont.csTimes: return "Times-Roman"; case predefinedFont.csTimesBold: return "Times-Bold"; case predefinedFont.csTimesOblique: return "Times-Italic"; case predefinedFont.csTimesBoldOblique: return "Times-BoldItalic"; default: return ""; } }
/// <summary> /// Class's constructor /// </summary> public pdfTableRowStyle(predefinedFont fontType, int fontSize, pdfColor fontColor, pdfColor bgColor) { _fontType = fontType; _fontSize = fontSize; _fontColor = fontColor; _bgColor = bgColor; }
/// <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> public void addText(string newText, int X, int Y, predefinedFont fontType, int fontSize) { textElement objText = new textElement(newText, fontSize, fontType, X, Y); _persistentElements.Add(objText); objText = null; }
/// <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 /// </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> public paragraphElement(IEnumerable newContent, int newFontSize, predefinedFont newFontType, int newCoordX, int newCoordY) { _content = newContent; _fontSize = newFontSize; _fontType = newFontType; _coordX = newCoordX; _coordY = newCoordY; }
/// <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> public textElement(string newContent, int newFontSize, predefinedFont newFontType, int newCoordX, int newCoordY) { _content = newContent; _fontSize = newFontSize; _fontType = newFontType; _coordX = newCoordX; _coordY = newCoordY; }
/// <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> public textElement(string newContent, int newFontSize, predefinedFont newFontType, int newCoordX, int newCoordY) { _content = newContent; _fontSize = newFontSize; _fontType = newFontType; _coordX = newCoordX; _coordY = newCoordY; }
/// <summary> /// Class's constructor /// </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> public paragraphElement(IEnumerable newContent, int newFontSize, predefinedFont newFontType, int newCoordX, int newCoordY) { _content = newContent; _fontSize = newFontSize; _fontType = newFontType; _coordX = newCoordX; _coordY = newCoordY; }
/// <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); }
/// <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, pdfColor newStrokeColor) { _content = newContent; _fontSize = newFontSize; _fontType = newFontType; _coordX = newCoordX; _coordY = newCoordY; _strokeColor = newStrokeColor; }
/// <summary> /// Class's constructor /// </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, pdfColor newStrokeColor) { _content = newContent; _fontSize = newFontSize; _fontType = newFontType; _coordX = newCoordX; _coordY = newCoordY; _strokeColor = newStrokeColor; }
/// <summary> /// Class's constructor /// </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, pdfColor newStrokeColor) { _content = newContent; _fontSize = newFontSize; _fontType = newFontType; _coordX = newCoordX; _coordY = newCoordY; _strokeColor = newStrokeColor; }
/// <summary> /// Static Method that returns the lenght of a single word /// </summary> /// <param name="word">Input word</param> /// <param name="fontSize">Font's size</param> /// <param name="fontType">Font's type</param> /// <returns>Size of the word</returns> public static int wordWeight(string word, int fontSize, predefinedFont fontType) { double returnWeight = 0; foreach (char myChar in word.ToCharArray()) { returnWeight += textAdapter.fontWeight[Convert.ToInt32(fontType) - 1][Convert.ToByte(myChar)]; } return(Convert.ToInt32(returnWeight * fontSize / 1000)); }
/// <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(); } }
/// <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> public void addParagraph(IEnumerable newText, int x, int y, predefinedFont fontType, int fontSize) { try { paragraphElement objParagraph = new paragraphElement(newText, fontSize, fontType, x, y); _persistentElements.Add(objParagraph); objParagraph = null; } catch (pdfIncorrectParagraghException ex) { UnityEngine.Debug.Log(ex); throw new pdfIncorrectParagraghException(); } }
/// <summary> /// Static Method that crop a word to put it in a predefined space /// </summary> /// <param name="word">Input word</param> /// <param name="fontSize">Font's size</param> /// <param name="fontType">Font's type</param> /// <param name="textSpace">Max text's space</param> /// <returns>Cropped word</returns> public static string cropWord(string word, int fontSize, predefinedFont fontType, int textSpace) { StringBuilder tempWord = new StringBuilder(); int i = 0; while ((wordWeight(tempWord.ToString(), fontSize, fontType)<= textSpace) && (i < word.Length)) { if ((word[i] >= 0) && (word[i] <= 255)) { tempWord.Append(word.ToCharArray()[i]); } i++; } if (tempWord.ToString().CompareTo(word) != 0) { tempWord.Remove(tempWord.Length - 3, 3); tempWord.Append("..."); } return tempWord.ToString(); }
/// <summary> /// Static Method that crop a word to put it in a predefined space /// </summary> /// <param name="word">Input word</param> /// <param name="fontSize">Font's size</param> /// <param name="fontType">Font's type</param> /// <param name="textSpace">Max text's space</param> /// <returns>Cropped word</returns> public static string cropWord(string word, int fontSize, predefinedFont fontType, int textSpace) { StringBuilder tempWord = new StringBuilder(); int i = 0; while ((wordWeight(tempWord.ToString(), fontSize, fontType) <= textSpace) && (i < word.Length)) { tempWord.Append(word.ToCharArray()[i]); i++; } if (tempWord.ToString().CompareTo(word) != 0) { tempWord.Remove(tempWord.Length - 3, 3); tempWord.Append("..."); } return(tempWord.ToString()); }
/// <summary> /// Static Mehtod that returns the name of the font /// </summary> /// <param name="fontType">Font's Type</param> /// <returns>String that contains the name of the font</returns> public static string getFontName(predefinedFont fontType) { switch (fontType) { case predefinedFont.csHelvetica: return("Helvetica"); case predefinedFont.csHelveticaBold: return("Helvetica-Bold"); case predefinedFont.csHelveticaOblique: return("Helvetica-Oblique"); case predefinedFont.csHelvetivaBoldOblique: return("Helvetica-BoldOblique"); case predefinedFont.csCourier: return("Courier"); case predefinedFont.csCourierBold: return("Courier-Bold"); case predefinedFont.csCourierOblique: return("Courier-Oblique"); case predefinedFont.csCourierBoldOblique: return("Courier-BoldOblique"); case predefinedFont.csTimes: return("Times-Roman"); case predefinedFont.csTimesBold: return("Times-Bold"); case predefinedFont.csTimesOblique: return("Times-Italic"); case predefinedFont.csTimesBoldOblique: return("Times-BoldItalic"); default: return(""); } }
/// <summary> /// Static method thats format a paragraph /// </summary> /// <param name="strText">Input Text</param> /// <param name="fontSize">Font's size</param> /// <param name="fontType">Font's type</param> /// <param name="parWidth">Paragrapfh's width</param> /// <param name="lineHeight">Line's height</param> /// <returns>IEnumerable interface that cointains paragraphLine objects</returns> public static IEnumerable formatParagraph(string strText,int fontSize,predefinedFont fontType,int parWidth,int lineHeight) { return formatParagraph(strText,fontSize,fontType,parWidth,lineHeight,predefinedAlignment.csLeft); }
/// <summary> /// Static method thats format a paragraph /// </summary> /// <param name="strText">Input Text</param> /// <param name="fontSize">Font's size</param> /// <param name="fontType">Font's type</param> /// <param name="parWidth">Paragrapfh's width</param> /// <param name="lineHeight">Line's height</param> /// <param name="parAlign">Paragraph's Alignment</param> /// <returns>IEnumerable interface that cointains paragraphLine objects</returns> public static IEnumerable formatParagraph(string strText, int fontSize, predefinedFont fontType, int parWidth, int lineHeight, predefinedAlignment parAlign) { string[] paragraphsArray = strText.Split("\n".ToCharArray()); string[] bufferArray; int lineLength; paragraphLine tempPar; StringBuilder lineString = new StringBuilder(parWidth); ArrayList resultArray = new ArrayList(); lineLength = 0; foreach (string paragraph in paragraphsArray) { bufferArray = paragraph.Split(" ".ToCharArray()); foreach (string word in bufferArray) { if ((textAdapter.wordWeight(word + " ", fontSize, fontType) + lineLength) > parWidth) { switch (parAlign) { case predefinedAlignment.csLeft: default: tempPar = new paragraphLine(lineString.ToString(0, lineString.Length - 1), lineHeight, 0); break; case predefinedAlignment.csRight: tempPar = new paragraphLine(lineString.ToString(0, lineString.Length - 1), lineHeight, parWidth - lineLength); break; case predefinedAlignment.csCenter: tempPar = new paragraphLine(lineString.ToString(0, lineString.Length - 1), lineHeight, Convert.ToInt32((parWidth - lineLength) / 2)); break; } resultArray.Add(tempPar); lineString.Remove(0, lineString.Length); lineLength = 0; } lineString.Append(word + " "); lineLength += textAdapter.wordWeight(word + " ", fontSize, fontType); } if (lineLength > 0) { switch (parAlign) { case predefinedAlignment.csLeft: default: tempPar = new paragraphLine(lineString.ToString(0, lineString.Length - 1), lineHeight, 0); break; case predefinedAlignment.csRight: tempPar = new paragraphLine(lineString.ToString(0, lineString.Length - 1), lineHeight, parWidth - lineLength); break; case predefinedAlignment.csCenter: tempPar = new paragraphLine(lineString.ToString(0, lineString.Length - 1), lineHeight, Convert.ToInt32((parWidth - lineLength) / 2)); break; } resultArray.Add(tempPar); lineString.Remove(0, lineString.Length); lineLength = 0; } bufferArray = null; } return(resultArray); }
/// <summary> /// Class's constructor /// </summary> /// <param name="newFontStyle">Font's style</param> /// <param name="newFontNumber">Font's number in the PDF </param> public pdfFont(predefinedFont newFontStyle, int newFontNumber) { _fontStyle = newFontStyle; _fontNumber = newFontNumber; }
/// <summary> /// Class's constructor /// </summary> /// <param name="newFontStyle">Font's style</param> /// <param name="newFontNumber">Font's number in the PDF </param> public pdfFont(predefinedFont newFontStyle, int newFontNumber) { _fontStyle = newFontStyle; _fontNumber = newFontNumber; }
/// <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> public void addParagraph(string newText, int x, int y, predefinedFont fontType, int fontSize, int parWidth) { paragraphElement objParagraph = new paragraphElement(textAdapter.formatParagraph(newText, fontSize, fontType, parWidth), fontSize, fontType, x, y); _elements.Add(objParagraph); objParagraph = null; }
/// <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 /// </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(); } }
/// <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; }
/// <summary> /// Static Method that returns the lenght of a single word /// </summary> /// <param name="word">Input word</param> /// <param name="fontSize">Font's size</param> /// <param name="fontType">Font's type</param> /// <returns>Size of the word</returns> public static int wordWeight(string word,int fontSize,predefinedFont fontType) { double returnWeight = 0; foreach(char myChar in word.ToCharArray()) { if ((myChar >= 0) && (myChar <= 255)) { returnWeight += textAdapter.fontWeight[Convert.ToInt32(fontType) - 1][Convert.ToByte(myChar)]; } } return Convert.ToInt32(returnWeight * fontSize /1000); }
/// <summary> /// Static method thats format a paragraph /// </summary> /// <param name="strText">Input Text</param> /// <param name="fontSize">Font's size</param> /// <param name="fontType">Font's type</param> /// <param name="parWidth">Paragrapfh's width</param> /// <param name="lineHeight">Line's height</param> /// <param name="parAlign">Paragraph's Alignment</param> /// <returns>IEnumerable interface that cointains paragraphLine objects</returns> public static IEnumerable formatParagraph(string strText,int fontSize,predefinedFont fontType,int parWidth,int lineHeight,predefinedAlignment parAlign) { string[] paragraphsArray = strText.Split("\n".ToCharArray()); string[] bufferArray; int lineLength; paragraphLine tempPar; StringBuilder lineString = new StringBuilder(parWidth); ArrayList resultArray = new ArrayList(); lineLength = 0; foreach(string paragraph in paragraphsArray) { bufferArray = paragraph.Split(" ".ToCharArray()); foreach(string word in bufferArray) { if ((textAdapter.wordWeight(word + " ",fontSize,fontType) + lineLength) > parWidth) { switch (parAlign) { case predefinedAlignment.csLeft: default: tempPar = new paragraphLine(lineString.ToString(0,lineString.Length - 1),lineHeight,0); break; case predefinedAlignment.csRight: tempPar = new paragraphLine(lineString.ToString(0,lineString.Length - 1),lineHeight,parWidth - lineLength); break; case predefinedAlignment.csCenter: tempPar = new paragraphLine(lineString.ToString(0,lineString.Length - 1),lineHeight,Convert.ToInt32((parWidth - lineLength) / 2)); break; } resultArray.Add(tempPar); lineString.Remove(0,lineString.Length); lineLength = 0; } lineString.Append(word + " "); lineLength += textAdapter.wordWeight(word + " ",fontSize,fontType); } if (lineLength > 0) { switch (parAlign) { case predefinedAlignment.csLeft: default: tempPar = new paragraphLine(lineString.ToString(0,lineString.Length - 1),lineHeight,0); break; case predefinedAlignment.csRight: tempPar = new paragraphLine(lineString.ToString(0,lineString.Length - 1),lineHeight,parWidth - lineLength); break; case predefinedAlignment.csCenter: tempPar = new paragraphLine(lineString.ToString(0,lineString.Length - 1),lineHeight,Convert.ToInt32((parWidth - lineLength) / 2)); break; } resultArray.Add(tempPar); lineString.Remove(0,lineString.Length); lineLength = 0; } bufferArray = null; } return resultArray; }
/// <summary> /// Method that adds an image to the page object /// </summary> /// <param name="newImgObject">Image Object</param> /// <param name="X">X position of the image in the page</param> /// <param name="Y">Y position of the image in the page</param> // public void addImage(Image newImgObject, int X, int Y) // { // try { // imageElement objImage = new imageElement(newImgObject, X, Y); // _persistentElements.Add(objImage); // objImage = null; // } catch (pdfImageNotFoundException ex) { // throw new pdfImageNotFoundException(ex.Message,ex); // } catch (pdfImageIOException ex) { // throw new pdfImageIOException(ex.Message,ex); // } // } /// <summary> /// Method that adds an image to the page object /// </summary> /// <param name="newImgSource">Image's name</param> /// <param name="X">X position of the image in the page</param> /// <param name="Y">Y position of the image in the page</param> /// <param name="height">New height of the image</param> /// <param name="width">New width of the image</param> // public void addImage(string newImgSource, int X, int Y, int height, int width) // { // try { // imageElement objImage = new imageElement(newImgSource, X, Y, height, width); // _persistentElements.Add(objImage); // objImage = null; // } catch (pdfImageNotFoundException ex) { // throw new pdfImageNotFoundException(ex.Message,ex); // } catch (pdfImageIOException ex) { // throw new pdfImageIOException(ex.Message,ex); // } // } /// <summary> /// Method that adds an image to the page object /// </summary> /// <param name="newImgObject">Image Object</param> /// <param name="X">X position of the image in the page</param> /// <param name="Y">Y position of the image in the page</param> /// <param name="height">New height of the image</param> /// <param name="width">New width of the image</param> // public void addImage(Image newImgObject, int X, int Y, int height, int width) // { // try { // imageElement objImage = new imageElement(newImgObject, X, Y, height, width); // _persistentElements.Add(objImage); // objImage = null; // } catch (pdfImageNotFoundException ex) { // throw new pdfImageNotFoundException(ex.Message,ex); // } catch (pdfImageIOException ex) { // throw new pdfImageIOException(ex.Message,ex); // } // } /// <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> public void addText(string newText, int X, int Y, predefinedFont fontType, int fontSize) { textElement objText = new textElement(newText, fontSize, fontType, X, Y); _persistentElements.Add(objText); objText = null; }
/// <summary> /// Static method thats format a paragraph /// </summary> /// <param name="strText">Input Text</param> /// <param name="fontSize">Font's size</param> /// <param name="fontType">Font's type</param> /// <param name="parWidth">Paragrapfh's width</param> /// <returns>IEnumerable interface that cointains paragraphLine objects</returns> public static IEnumerable formatParagraph(string strText, int fontSize, predefinedFont fontType, int parWidth) { return(formatParagraph(strText, fontSize, fontType, parWidth, fontSize + 4, predefinedAlignment.csLeft)); }
/// <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> public void addParagraph(IEnumerable newText, int x, int y, predefinedFont fontType, int fontSize) { try { paragraphElement objParagraph = new paragraphElement(newText, fontSize, fontType, x, y); _persistentElements.Add(objParagraph); objParagraph = null; } catch (pdfIncorrectParagraghException ex) { UnityEngine.Debug.Log ( ex ); throw new pdfIncorrectParagraghException(); } }