当前位置: 首页>>代码示例>>C#>>正文


C# pdf.BaseFont类代码示例

本文整理汇总了C#中iTextSharp.text.pdf.BaseFont的典型用法代码示例。如果您正苦于以下问题:C# BaseFont类的具体用法?C# BaseFont怎么用?C# BaseFont使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BaseFont类属于iTextSharp.text.pdf命名空间,在下文中一共展示了BaseFont类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnOpenDocument

 public override void OnOpenDocument(PdfWriter writer, Document document)
 {
     printTime = DateTime.Now;
     string arialuniTff = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "ARIALUNI.TTF");
     baseFont = BaseFont.CreateFont(arialuniTff, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
     pdfContent = writer.DirectContent;
     pageNumberTemplate = pdfContent.CreateTemplate(50, 50);
 }
开发者ID:vamelnyk,项目名称:CorporateEmployeeServiceSystem,代码行数:8,代码来源:PrintHeaderFooter.cs

示例2: CreatePdf

// ---------------------------------------------------------------------------    
    /**
     * Creates a PDF document.
     */
    public byte[] CreatePdf(BaseFont bf, String text) {
      using (MemoryStream ms = new MemoryStream()) {
        using (Document document = new Document()) {
          PdfWriter.GetInstance(document, ms);
          document.Open();
          document.Add(new Paragraph(text, new Font(bf, 12)));
        }
        return ms.ToArray();
      }
    }    
开发者ID:,项目名称:,代码行数:14,代码来源:

示例3: OnOpenDocument

 public override void OnOpenDocument(PdfWriter writer, Document document)
 {
     base.OnOpenDocument(writer, document);
     font = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
     dc = writer.DirectContent;
     tpl = dc.CreateTemplate(50, 50);
 }
开发者ID:stevesloka,项目名称:bvcms,代码行数:7,代码来源:EnrollmentControlResult.cs

示例4: OnOpenDocument

 // we override the onOpenDocument method
 public override void OnOpenDocument(PdfWriter writer, Document document)
 {
     _bf = _normalFont.GetCalculatedBaseFont(false);
     _cb = writer.DirectContent;
     _ct = new ColumnText(_cb);
     base.OnOpenDocument(writer, document);
 }
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:8,代码来源:rptFieldContracting.cs

示例5: OnOpenDocument

        public override void OnOpenDocument(PdfWriter writer, Document document)
        {
            total = writer.DirectContent.CreateTemplate(100, 100);
            total.BoundingBox = new Rectangle(-20, -20, 100, 100);

            helv = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED);
        }
开发者ID:woofwoof88,项目名称:first-place-processing,代码行数:7,代码来源:pdfPrintEnvelopes.ashx.cs

示例6: OnOpenDocument

 public override void OnOpenDocument(PdfWriter writer, Document document)
 {
     printTime = DateTime.Now;
     baseFont = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
     pdfContent = writer.DirectContent;
     pageNumberTemplate = pdfContent.CreateTemplate(50, 50);
 }
开发者ID:huutruongqnvn,项目名称:vnecoo01,代码行数:7,代码来源:PrintHeaderFooter.cs

示例7: StarSeparator

// ---------------------------------------------------------------------------    
    /**
     * Constructs a positioned Arrow mark.
     * @param    left    if true, an arrow will be drawn on the left;
     * otherwise, it will be drawn on the right.
     * @throws IOException 
     * @throws DocumentException 
     */
    public StarSeparator() {
      try {
        bf = BaseFont.CreateFont();
      } catch {
        bf = null;
        throw;
      }
    }
开发者ID:,项目名称:,代码行数:16,代码来源:

示例8: PDFWriter

        public PDFWriter()
        {
            //Initialization
            DEFAULT_FONTSIZE = 12.0f;
            DEFAULT_HEADINGSIZE = 16.0f;
            FONTNAME = "segoeui.ttf";

            string fg = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), FONTNAME);
            baseFont = BaseFont.CreateFont(fg, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
        }
开发者ID:drdaemos,项目名称:ODTCONVERTvs10,代码行数:10,代码来源:PDFWriter.cs

示例9: PositionedArrow

// ---------------------------------------------------------------------------    
    /**
     * Constructs a positioned Arrow mark.
     * @param    left    if true, an arrow will be drawn on the left;
     * otherwise, it will be drawn on the right.
     * @throws IOException 
     * @throws DocumentException 
     */
    public PositionedArrow(bool left) {
      this.left = left;
      try {
        zapfdingbats = BaseFont.CreateFont(
          BaseFont.ZAPFDINGBATS, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED
        );
      }
      catch {
        zapfdingbats = null;
        throw;
      }
    }
开发者ID:,项目名称:,代码行数:20,代码来源:

示例10: Report

 //public Report()
 //{
 //    fntHeading = FontFactory.GetFont(FontFactory.HELVETICA, 7, Font.BOLD, new Color(0x00, 0x00, 0x00));
 //    fntDetails = FontFactory.GetFont(FontFactory.HELVETICA, 7, Font.NORMAL, new Color(0x00, 0x00, 0x00));
 //    bf = BaseFont.CreateFont(BaseFont.HELVETICA_BOLD, BaseFont.CP1250, BaseFont.NOT_EMBEDDED);
 //    doc = new Document(PageSize.A4 , 35, 35, 35, 35);
 //    writer = PdfWriter.GetInstance(doc, ms);
 //    MyPageEvents events = new MyPageEvents();
 //    writer.PageEvent = events;
 //}
 public Report(bool Landscape)
 {
     fntHeading = FontFactory.GetFont(FontFactory.HELVETICA, 7, Font.BOLD, new Color(0x00, 0x00, 0x00));
     fntDetails = FontFactory.GetFont(FontFactory.HELVETICA, 7, Font.NORMAL, new Color(0x00, 0x00, 0x00));
     bf = BaseFont.CreateFont(BaseFont.HELVETICA_BOLD, BaseFont.CP1250, BaseFont.NOT_EMBEDDED);
     if(Landscape)
         doc = new Document(PageSize.A4.Rotate(), 35, 35, 35, 35);
     else
         doc = new Document(PageSize.A4, 35, 35, 35, 35);
     writer = PdfWriter.GetInstance(doc, ms);
     MyPageEvents events = new MyPageEvents();
     writer.PageEvent = events;
 }
开发者ID:paulallies,项目名称:tsdt,代码行数:23,代码来源:Report.cs

示例11: OnOpenDocument

        public void OnOpenDocument(PdfWriter writer, Document document)
        {
            _baseFont = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.EMBEDDED);
            _frontPageFont = BaseFont.CreateFont(BaseFont.HELVETICA_BOLD, BaseFont.CP1252, BaseFont.EMBEDDED);
            _content = writer.DirectContent;

            if (!string.IsNullOrEmpty(_settings.PageTemplate))
            {
                var reader = new PdfReader(_settings.PageTemplate);
                _template = writer.GetImportedPage(reader, 1);
            }

            WriteFrontPage(writer, document);
        }
开发者ID:marcostomazini,项目名称:ReleaseNotes,代码行数:14,代码来源:ReleaseNotesPdfPageEvents.cs

示例12: PdfHelper

        public PdfHelper()
        {
            try
            {
                defaultFontSize = 10;//默認字体大小
                basefont = BaseFont.CreateFont("C:/Windows/Fonts/msyh.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);//默認字体为微软雅黑

                font = new Font(basefont,defaultFontSize);
                document = new Document(PageSize.A4);
            }
            catch (Exception ex)
            {
                throw new Exception("PdfManagement-->CreateFont-->" + ex.Message);
            }

        }
开发者ID:lxh2014,项目名称:gigade-net,代码行数:16,代码来源:PdfHelper.cs

示例13: SetTemplateFont

        /// <summary>
        /// Set font family and font size on all text fields for consistency
        /// </summary>
        /// <param name="stamperFields">
        /// PdfStamper.AcroFields - so we can set the form field value here.
        /// </param>
        /// <param name="family">BaseFont</param>
        /// <param name="size">Desired size</param>
        public static void SetTemplateFont(AcroFields stamperFields, BaseFont family, float size)
        {
            // ignore everything except text fields
            var textFields = stamperFields.Fields.Keys
                .Where(x => stamperFields.GetFieldType(x) == AcroFields.FIELD_TYPE_TEXT
                    && GetFontSize(stamperFields, x) != 0f
                )
                .ToDictionary(k => k);

            Console.WriteLine(string.Join(" :: ", textFields.Keys.ToArray()));

            foreach (var key in textFields.Keys)
            {
                stamperFields.SetFieldProperty(key, "textfont", family, null);
                stamperFields.SetFieldProperty(key, "textsize", size, null);
            }
        }
开发者ID:kuujinbo,项目名称:StackOverflow.iTextSharp,代码行数:25,代码来源:TextBoxField.cs

示例14: SetUp

        public void SetUp()
        {
            PdfReader reader = new PdfReader(
                TestResourceUtils.GetResourceAsStream(TEST_RESOURCES_PATH, "fontWithToUnicode.pdf"));
            PdfDictionary resourcesDict = reader.GetPageResources(1);
            PdfDictionary fontsDict = resourcesDict.GetAsDict(PdfName.FONT);
            foreach (PdfName key in fontsDict.Keys)
            {
                PdfObject pdfFont = fontsDict.Get(key);

                if (pdfFont is PRIndirectReference)
                {
                    fontWithToUnicode = BaseFont.CreateFont((PRIndirectReference)pdfFont);
                    break;
                }
            }
        }
开发者ID:,项目名称:,代码行数:17,代码来源:

示例15: PdfRenderer

        public PdfRenderer()
        {
            PageWidth = PageSize.A4.Width;
            PageHeight = PageSize.A4.Height;

            string fontpath = "ReportSharp.Fonts.tahoma.ttf";
            Stream stream = this.GetType().Assembly.GetManifestResourceStream(fontpath);
            byte[] buff = StreamHelper.ReadToEnd(stream);

            font = BaseFont.CreateFont("tahoma.ttf", "CP1254", BaseFont.EMBEDDED, false, buff, null, false, true);

            fontpath = "ReportSharp.Fonts.tahomabd.ttf";
            stream = this.GetType().Assembly.GetManifestResourceStream(fontpath);
            buff = StreamHelper.ReadToEnd(stream);

            fontBold = BaseFont.CreateFont("tahomabd.ttf", "CP1254", BaseFont.EMBEDDED, false, buff, null, false, true);
        }
开发者ID:koraytaylan,项目名称:ReportSharp,代码行数:17,代码来源:PdfRenderer.cs


注:本文中的iTextSharp.text.pdf.BaseFont类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。