コード例 #1
0
ファイル: ExportOps.cs プロジェクト: ucdavis/EatFit
        private Font ConvertPDFFonts(PDFFonts textFont)
        {
            switch (textFont)
            {
            case PDFFonts.TimesRoman:       return(Font.TimesRoman);

            case PDFFonts.TimesBold:        return(Font.TimesBold);

            case PDFFonts.TimesItalic:      return(Font.TimesItalic);

            case PDFFonts.Courier:          return(Font.Courier);

            case PDFFonts.CourierBold:      return(Font.CourierBold);

            case PDFFonts.CourierOblique:   return(Font.CourierOblique);

            case PDFFonts.Helvetica:        return(Font.Helvetica);

            case PDFFonts.HelveticaBold:    return(Font.HelveticaBold);

            case PDFFonts.HelveticaBoldOblique: return(Font.HelveticaBoldOblique);

            default: return(Font.TimesRoman);
            }
        }
コード例 #2
0
ファイル: ExportOps.cs プロジェクト: ucdavis/EatFit
 /// <summary>
 /// Adds a text label object to the specified page.
 /// </summary>
 /// <param name="text">The text that you want to be displayed in the label.</param>
 /// <param name="xCoordinate">X-Coordinate label should be located.</param>
 /// <param name="yCoordinate">Y-Coordinate label should be located.</param>
 /// <param name="width">Width of the label.</param>
 /// <param name="height">Height of the label.</param>
 /// <param name="font">The font to be used for the label.</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 PDFAddLabel(string text, float xCoordinate, float yCoordinate, float width, float height, PDFFonts font, int pageNumber)
 {
     return(this.PDFAddLabel(text, xCoordinate, yCoordinate, width, height, font, this._PDFDefaultTextSize, pageNumber));
 }
コード例 #3
0
ファイル: ExportOps.cs プロジェクト: ucdavis/EatFit
        /// <summary>
        /// Adds a text label object to the specified page.
        /// </summary>
        /// <param name="text">The text that you want to be displayed in the label.</param>
        /// <param name="xCoordinate">X-Coordinate label should be located.</param>
        /// <param name="yCoordinate">Y-Coordinate label should be located.</param>
        /// <param name="width">Width of the label.</param>
        /// <param name="height">Height of the label.</param>
        /// <param name="font">The font to be used for the label.</param>
        /// <param name="textSize">The text size.</param>
        /// <param name="txtAlign">Alignment within the label (left, right, center).</param>
        /// <param name="txtColor">Color of the text.</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 PDFAddLabel(string text, float xCoordinate, float yCoordinate, float width, float height, PDFFonts font, float textSize, PDFTextAlign txtAlign, PDFColor txtColor, int pageNumber)
        {
            if (pageNumber > this._PDFDocumentPages.Count)
            {
                return(false);
            }

            ArrayList tempArray = new ArrayList();

            tempArray.Add(PDFObjectType.Label);
            tempArray.Add(text);
            tempArray.Add(xCoordinate);
            tempArray.Add(yCoordinate);
            tempArray.Add(width);
            tempArray.Add(height);
            tempArray.Add(this.ConvertPDFFonts(font));      // Insert the preferred type fron the ceTe library
            tempArray.Add(textSize);
            tempArray.Add(this.ConvertTextAlign(txtAlign)); // Insert the preferred type from the ceTe library
            tempArray.Add(this.ConvertPDFColor(txtColor));  // Insert the preferred type from the ceTe library

            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);
        }