首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用spire.doc将文档转换为PDF

使用spire.doc将文档转换为PDF
EN

Stack Overflow用户
提问于 2015-07-24 14:38:28
回答 1查看 1.6K关注 0票数 0

我需要转换word文档为PDF。我使用spire.doc也是为了同样的目的。除了一个之外,一切都很好。我有一个在Word文档中定义的标题部分,转换后在PDF中丢失。有人能帮我解决这个问题吗?

谢谢

EN

回答 1

Stack Overflow用户

发布于 2015-07-24 14:48:10

你有没有试过这个:

代码语言:javascript
复制
Section section = document.Sections[0];
HeaderFooter header = section.HeadersFooters.Header;
Paragraph HParagraph = header.AddParagraph();
TextRange HText = HParagraph.AppendText("Spire.Doc for .NET");

//Set Header Text Format
HText.CharacterFormat.FontName = "Algerian";
HText.CharacterFormat.FontSize = 15;
HText.CharacterFormat.TextColor = Color.RoyalBlue;

//Set Header Paragraph Format
HParagraph.Format.HorizontalAlignment = HorizontalAlignment.Left;
HParagraph.Format.Borders.Bottom.BorderType=BorderStyle.ThickThinMediumGap;
HParagraph.Format.Borders.Bottom.Space = 0.05f;
HParagraph.Format.Borders.Bottom.Color = Color.DarkGray;

来自here的说明

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31603806

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档