We want to add headings to pages and - if the topic doesn’t fit on one page - write a [continued] heading on the next page.
The [continued] addition should be written in a smaller font.
We tried several scenarios, but the font of the segment is always the same as the font of the heading itself.
Please take a look at the following simplified sample code:
Aspose.Pdf.License license = new Aspose.Pdf.License();
// Instantiate license file
license.SetLicense("LGSolutions.Finance.Portal.Aspose.Pdf.lic");
// Set the value to indicate that license will be embedded in the application
license.Embedded = true;
var pdf = new Aspose.Pdf.Document();
Page page = pdf.Pages.Add();
var heading = new Heading(1) { Text = "Header 1" };
page.Paragraphs.Add(heading);
heading.TextState.Font = Aspose.Pdf.Text.FontRepository.FindFont("Times New Roman");
heading.TextState.FontSize = 20;
Aspose.Pdf.Text.TextSegment segment2 = new Aspose.Pdf.Text.TextSegment(" [continued]");
segment2.TextState.FontSize = 10;
heading.Segments.Add(segment2);
var memoryStream = new MemoryStream();
pdf.Save(memoryStream);
memoryStream.CopyTo(this.Response.OutputStream);
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "inline; filename=Test");
return new EmptyResult();
Thanks for your assistance!