Hi,
What's the easiest way to remove the header from the first page of PDF using Spire.Doc. Also we want to be able to add line breaks between two lines of header.
Here is the code we are using to write the header to all the pages in the PDF.
private void SetHeader(Document document, Color fontColor, string headerText = "", string fontName = "Calibri",
float fontSize = (float)12.0, HorizontalAlignment alignment = HorizontalAlignment.Left)
{
TextRange text;
Section section = document.Sections[0];
HeaderFooter header = section.HeadersFooters.Header;
//insert text to header
Paragraph headerParagraph = header.AddParagraph();
//header text
text = headerParagraph.AppendText(headerText);
text.CharacterFormat.FontName = fontName;
text.CharacterFormat.FontSize = Convert.ToSingle(fontSize);
text.CharacterFormat.TextColor = fontColor;
headerParagraph.Format.HorizontalAlignment = alignment;
//border
headerParagraph.Format.Borders.Bottom.BorderType = (Spire.Doc.Documents.BorderStyle)Spire.Doc.Documents.BorderStyle.Hairline;
headerParagraph.Format.Borders.Bottom.Space = (float)0.03;
}