font_selector: Example code of Early Access iText

简介:
using  System;
using  iTextSharp.text;
using  iTextSharp.text.pdf;
using  System.IO;
public   class  font_selector
{
    
    [STAThread]
    
public   static   void   Main( string [] args)
    {
        
try
        {
            Document document 
=   new  Document();
            PdfWriter writer 
=  PdfWriter.GetInstance(document,  new  FileStream( @" e:\java\font_selector.Pdf " , FileMode.Create));
            document.Open();
            
string  text  =   " This text is the first verse of \u275dThe Iliad\u275e. It's not polytonic as it should be  "  
                
+   " with \u2798 and \u279a entoation variants but that's all we have for now.\n\n "  
                
+   " \u2766\u00a0\u00a0\u039c\u03b7\u03bd\u03b9\u03bd \u03b1\u03b5\u03b9\u03b4\u03b5, "
                
+   " \u03b8\u03b5\u03b1, \u03a0\u03b7\u03bb\u03b7\u03b9\u03b1\u03b4\u03b5\u03c9 \u0391 "
                
+   " \u03c7\u03b9\u03bb\u03b7\u03bf\u03c2 " ;
            FontSelector sel 
=   new  FontSelector();
            sel.AddFont(
new  Font(Font.TIMES_ROMAN,  12 ));
            sel.AddFont(
new  Font(Font.ZAPFDINGBATS,  12 ));
            sel.AddFont(
new  Font(Font.SYMBOL,  12 ));
            Phrase ph 
=  sel.Process(text);
            document.Add(
new  Paragraph(ph));
            document.Close();
        }
        
catch  (System.Exception de)
        {
            System.Console.Error.WriteLine(de.Message);
        }
        System.Console.Out.WriteLine(
" Fim. " );
    }
}
 
 
本文转自 RubyPdf 的中文博客博客园博客,原文链接: http://www.cnblogs.com/hardrock/archive/2006/07/24/458155.html /,如需转载请自行联系原作者
相关文章
《Alibaba_Cloud_Whitepaper_-_Data_Security_is_Now_More_Important_Than_Ever.pdf》电子版地址
Alibaba_Cloud_Whitepaper_-_Data_Security_is_Now_More_Important_Than_Ever.pdf
94 0
《Alibaba_Cloud_Whitepaper_-_Data_Security_is_Now_More_Important_Than_Ever.pdf》电子版地址
成功解决OSError: cannot open resource self.font = core.getfont(font, size, index, encoding, layout_engin
成功解决OSError: cannot open resource self.font = core.getfont(font, size, index, encoding, layout_engin
- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as t
vue.js报错如下: - Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as , as they will not be parsed.
5663 1
|
Web App开发 JavaScript 前端开发
Is server side rendering a good choice for React application
Single page application like react provides a wonderful user experience, however, it comes with two issues: For user who accesses the website at first time, there is no cache of javascript files in
1534 0
simple rxjava code programming style
simple rxjava code programming style package zhangphil.rx; import android.
906 0
|
安全
Securing the Data Center in a Cloud First World
Looking for steps to protect your data center infrastructure with a multilayered, automated approach to security?
1523 0
|
Android开发 Spring
An internal error occurred during: &quot;Building UI model&quot;. com/google/common/base/Function
An internal error occurred during: "Building UI model". com/google/common/base/FunctionEclipse Neon.2 Release (4.6.2) 安装了 STS(Spring Tool Suite) 后,创建项目时遇到些问题。
2760 0
|
前端开发 JavaScript
Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.ABP 已经对该网站禁用了,但还是显示这个信息。
1369 0