0

我需要将word文档转换为PDF。我出于同样的目的使用 spire.doc。一切工作正常,但一个。我在 Word 文档中定义了一个标题部分,转换后 PDF 中缺少该标题部分。谁能帮我解决这个问题?

谢谢

4

1 回答 1

0

你有没有试过这个:

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;

来自这里的指令

于 2015-07-24T06:48:10.197 回答