在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
using iTextSharp.text; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using iTextSharp.text.pdf; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { // File.Create("d:\\a.pdf"); Document document = new Document(); BaseFont bf = BaseFont.CreateFont(@"C:\Windows\Fonts\MSYH.TTC,0", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); iTextSharp.text.Font f = new Font(bf,9); PdfWriter.GetInstance(document, new FileStream("d:\\a.pdf", FileMode.Create)); document.Open(); iTextSharp.text.Paragraph paragraph = new iTextSharp.text.Paragraph("Hello World你好sss",f); document.Add(paragraph); document.Close(); } } }
|
请发表评论