Hi,
I add content to a page’s header with the following code:
TextFragment tf = new TextFragment();
TextSegment t = new TextSegment("This is my Content");
t.TextState = pdfSettings.TextInfoHeadline;
tf.Segments.Add(t);
if (page != null)
{
page.Header = new HeaderFooter();
page.Header.Margin = new MarginInfo();
page.Header.Margin.Top = PdfSettings.CalcFromMM(10);
page.Header.Margin.Left = PdfSettings.CalcFromMM(10);
page.Header.Paragraphs.Add(tf);
}
page is of type Aspose.PDF.Page
The textstate is defined as followed:
public TextState TextInfoHeadline => new TextState
{
Font = defaultFontRegular,
ForegroundColor = Color.FromRgb(System.Drawing.Color.FromArgb(0, 73, 164)),
FontSize = 22
};
On the first Page the content in the header area is styled correct. If a second page is automatically added (automatic pagebreak) the header text ist shown in the correct place but the styling has gone - it looks like the Textstate is not copied to the page heades after the first page.
Any hints?
Best regards,
Andrei