using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using HtmlAgilityPack; using Xceed.Words.NET; namespace ConsoleApp2.test1 { public class Class3 { //原文:https://github.com/xceedsoftware/docx //Word文档转换为PDF 需要付费版 Xceed Words for .NET public void test1() { using (DocX document = DocX.Create(@"HelloWorld.docx")) { Paragraph p = document.InsertParagraph(); p.Append("Hello World!^011Hello World!赵杰迪") .Font(new Font("Times New Roman")) .FontSize(32) .Bold(); document.Save(); Console.WriteLine(" Created: docs\HelloWorld.docx "); } } } }