Home Features Download Tutorial Version History License PDF Mosaic Blog Source Code
This sample shows how to create cjk PDF Document in .NET
C# :
using PDFMosaic; using System.Drawing; namespace DrawText { class DrawText { static void Main() { PDFDocument document = new PDFDocument(); document.Pages.Add(new PDFPage(PDFPaperFormat.A4)); PDFCanvas canvas = document.Pages[0].Canvas; PDFFont font = new PDFFont("MingLiU", 14); PDFBrush brush = new PDFSolidBrush(); canvas.DrawString("這行是用繁體中文寫的", font, brush, 20, 20); canvas.DrawString("这行是用简体中文写的", font, brush, 20, 40); document.Save("CJKText.pdf", true); } } }
Visial Basic.NET :
Imports PDFMosaic Imports System.Drawing Module DrawText Sub Main() Dim document As New PDFDocument() document.Pages.Add(New PDFPage(PDFPaperFormat.A4)) Dim canvas As PDFCanvas = document.Pages(0).Canvas Dim font As New PDFFont("MingLiU", 14) Dim brush As New PDFSolidBrush() canvas.DrawString("這行是用繁體中文寫的", font, brush, 20, 20) canvas.DrawString("这行是用简体中文写的", font1, brush, 20, 40) document.Save("CJKText.pdf", True) End Sub End Module
Home Features Download Tutorial Version History License PDF Mosaic Blog Source Code