消防网站建设的风格,做海报的网站知乎,seo运营培训,阿里云服务器做网站需要备案Spire.Doc for .NET是一款专门对 Word 文档进行操作的 .NET 类库。在于帮助开发人员无需安装 Microsoft Word情况下#xff0c;轻松快捷高效地创建、编辑、转换和打印 Microsoft Word 文档。拥有近10年专业开发经验Spire系列办公文档开发工具#xff0c;专注于创建、编辑、转…Spire.Doc for .NET是一款专门对 Word 文档进行操作的 .NET 类库。在于帮助开发人员无需安装 Microsoft Word情况下轻松快捷高效地创建、编辑、转换和打印 Microsoft Word 文档。拥有近10年专业开发经验Spire系列办公文档开发工具专注于创建、编辑、转换和打印Word/PDF/Excel等格式文件处理小巧便捷。
E-iceblue功能类库Spire 系列文档处理组件均由中国本土团队研发不依赖第三方软件不受其他国家的技术或法律法规限制同时适配国产操作系统如中科方德、中标麒麟等兼容国产文档处理软件 WPS如 .wps/.et/.dps 等格式
Spire.Doc for.NET 最新下载qun767755948https://www.evget.com/product/3368/download
现在Spire.Doc支持在将Doc转换为PDF时使用未安装的字体以实现文本内容的多样化。在这篇文章中我们将谈论如何实现这一功能如何在通过Spire.Doc将Doc转换为PDF时使用卸载的字体
步骤1下载一个在系统中卸载的字体。 步骤2创建一个新的空白Word文档。 Document document new Document(); 步骤3添加一个部分并创建一个新段落。 Section section document.AddSection();
Paragraph paragraph section.Paragraphs.Count 0 ? section.Paragraphs[0] : section.AddParagraph(); 步骤4为 txtRange 附加文本。 TextRange txtRange paragraph.AppendText(text); 步骤5为名为pdf的类ToPdfParameterList创建一个示例并为属性PrivateFontPaths创建一个新的PrivateFontPathlist使用下载字体的名称和路径实例化一个PrivateFontPath。 ToPdfParameterList toPdf new ToPdfParameterList()
{
PrivateFontPaths new List()
{
new PrivateFontPath(DeeDeeFlowers,D:\DeeDeeFlowers.ttf)
}
}; 步骤6为 txtaRange 设置新字体。 txtRange.CharacterFormat.FontName DeeDeeFlowers; 步骤7将文档转换为 PDF。 document.SaveToFile(result.pdf, toPdf); 步骤8查看转换后的 PDF 文件。 System.Diagnostics.Process.Start(result.pdf); 结果截图 完整代码如下 Document document new Document();//Add the first secition
Section section document.AddSection();
//Create a new paragraph and get the first paragraph
Paragraph paragraphsection.Paragraphs.Count 0 ? section.Paragraphs[0] : section.AddParagraph();//Append Text
String textThis paragraph is demo of text font and color. The font name of this paragraph is Tahoma. The font size of this paragraph is 20. The under line style of this paragraph is DotDot. The color of this paragraph is Blue. ;
TextRange txtRange paragraph.AppendText(text);//Import the font
ToPdfParameterList toPdf new ToPdfParameterList()
{
PrivateFontPaths new ListPrivateFontPath()
{
new PrivateFontPath(DeeDeeFlowers,D:\DeeDeeFlowers.ttf)
}
};
//Make use of the font.
txtRange.CharacterFormat.FontName DeeDeeFlowers;document.SaveToFile(result.pdf, toPdf);System.Diagnostics.Process.Start(result.pdf); 以上便是通过Spire.Doc将Doc转换为PDF时如何使用卸载的字体的教程如果您有其他问题也可以继续浏览本系列文章获取相关教程你还可以给我留言哦~