using System; using System.IO; using System.Collections;using System.Collections.Generic; using System.Text; using PDFjet.NET; /** * Example_07.cs * */ public class Example_07 { public Example_07() { PDF pdf = new PDF(); pdf.SetFontPath("fonts/Gentium102"); Font f1 = new Font(pdf, "GenR102.ttf", CodePage.UNICODE, Embed.YES); Page page = new Page(pdf, Letter.PORTRAIT); f1.SetSize(18); int x_pos = 70; int y_pos = 10; TextLine text = new TextLine(f1); text.SetPosition(x_pos, y_pos); StringBuilder buf = new StringBuilder(); for (int i = 0x20; i < 0x7F; i++) { if (i % 16 == 0) { text.SetText(buf.ToString()); text.SetPosition(x_pos, y_pos += 24); text.DrawOn(page); buf = new StringBuilder(); } buf.Append((char) i); } y_pos += 24; buf = new StringBuilder(); for (int i = 0x390; i < 0x3EF; i++) { if (i % 16 == 0) { text.SetText(buf.ToString()); text.SetPosition(x_pos, y_pos += 24); text.DrawOn(page); buf = new StringBuilder(); } buf.Append((char) i); } y_pos += 24; buf = new StringBuilder(); for (int i = 0x410; i < 0x46F; i++) { if (i % 16 == 0) { text.SetText(buf.ToString()); text.SetPosition(x_pos, y_pos += 24); text.DrawOn(page); buf = new StringBuilder(); } buf.Append((char) i); } pdf.Wrap(); pdf.Save("Example_07.pdf"); } public static void Main(String[] args) { new Example_07(); } } // End of Example_07.cs