Ejemplo n.º 1
0
        private FontFamily ConvertPDFFontFamily(PDFFontFamily fontFamily)
        {
            switch (fontFamily)
            {
            case PDFFontFamily.Times: return(FontFamily.Times);

            case PDFFontFamily.Helvetica: return(FontFamily.Helvetica);

            case PDFFontFamily.Courier: return(FontFamily.Courier);

            default: return(FontFamily.Times);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a formatted text area to the specified page.
 /// </summary>
 /// <param name="text">The text that you want to be displayed in the text area.</param>
 /// <param name="xCoordinate">X-Coordinate text area should be located.</param>
 /// <param name="yCoordinate">Y-Coordinate text area should be located.</param>
 /// <param name="width">Width of the text area.</param>
 /// <param name="height">Height of the text area.</param>
 /// <param name="fontFamily">Font family that should be used on the text area.</param>
 /// <param name="pageNumber">Page number you would like image placed.</param>
 /// <returns>True if addition was successful, False if page number of out of bounds.</returns>
 public Boolean PDFAddFormattedTextArea(string text, float xCoordinate, float yCoordinate, float width, float height, PDFFontFamily fontFamily, int pageNumber)
 {
     return(this.PDFAddFormattedTextArea(text, xCoordinate, yCoordinate, width, height, fontFamily, this._PDFDefaultTextSize, pageNumber));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds a formatted text area to the specified page.
        /// </summary>
        /// <param name="text">The text that you want to be displayed in the text area.</param>
        /// <param name="xCoordinate">X-Coordinate text area should be located.</param>
        /// <param name="yCoordinate">Y-Coordinate text area should be located.</param>
        /// <param name="width">Width of the text area.</param>
        /// <param name="height">Height of the text area.</param>
        /// <param name="fontFamily">Font family that should be used on the text area.</param>
        /// <param name="textSize">The text size.</param>
        /// <param name="preserveWhiteSpace">Whether to preserve the white space, or treat it like html.</param>
        /// <param name="pageNumber">Page number you would like image placed.</param>
        /// <returns>True if addition was successful, False if page number of out of bounds.</returns>
        public Boolean PDFAddFormattedTextArea(string text, float xCoordinate, float yCoordinate, float width, float height, PDFFontFamily fontFamily, float textSize, Boolean preserveWhiteSpace, int pageNumber)
        {
            if (pageNumber > this._PDFDocumentPages.Count)
            {
                return(false);
            }

            ArrayList tempArray = new ArrayList();

            tempArray.Add(PDFObjectType.FormattedTextArea);
            tempArray.Add(text);
            tempArray.Add(xCoordinate);
            tempArray.Add(yCoordinate);
            tempArray.Add(width);
            tempArray.Add(height);
            tempArray.Add(this.ConvertPDFFontFamily(fontFamily));      // Insert the preferred type fron the ceTe library
            tempArray.Add(textSize);
            tempArray.Add(preserveWhiteSpace);

            pageNumber--;   // Decrement the number, because the arrray starts at 0 not 1

            // Add teh object to the array
            ArrayList tempArray2 = (ArrayList)this._PDFDocumentPages[pageNumber];

            tempArray2.Add(tempArray);

            return(true);
        }