Font_selector: Example code of Early Access iText

Source: Internet
Author: User
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 ();
Using writer = Using writer. 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 shocould be"
+ "With \ u2798 and \ u279a entoation variants but that's all we have for now. \ 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 .");
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.