The attached document shows a mysterious header line at the top of page 3 right in the middle of a loop where the software is printing a set of user data:
AddSectionHeader(builder, "AFFILIATIONS & COMMUNITY INVOLVEMENT");
foreach (var aff in resumeData.Affiliations)
{
if (string.IsNullOrEmpty(aff.CandidateAffiliation.Description))
{
builder.ParagraphFormat.SpaceAfter = 10;
builder.Writeln(aff.CandidateAffiliation.Name);
}
else
{
builder.Writeln(aff.CandidateAffiliation.Name);
builder.ParagraphFormat.SpaceAfter = 10;
builder.Writeln(aff.CandidateAffiliation.Description);
}
builder.ParagraphFormat.SpaceAfter = 0;
}
AddSectionHeader method does the following in an attempt to print a divider line followed by the header text:
builder.ParagraphFormat.ClearFormatting();
builder.Writeln(string.Empty);
builder.Font.Bold = true;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.ParagraphFormat.SpaceAfter = 10;
builder.ParagraphFormat.Borders.Top.LineWidth = 2.0;
builder.ParagraphFormat.Borders.Top.LineStyle = LineStyle.Single;
builder.ParagraphFormat.Borders.Top.Color = COLOR_DARK_BLUE;
builder.Font.Size = FONT_SIZE_HEADER;
builder.Writeln(text);
builder.ParagraphFormat.SpaceAfter = 0;
builder.Font.Size = FONT_SIZE_NORMAL;
builder.Font.Bold = false;
I’m guessing it may have to do with the page setup somehow, but why not until page 3–shouldn’t it also manifest on page 2? I don’t want the line there. I only want the border to show when printing a header with AddSectionHeader. Most of the code building this document follows a similar pattern: print a header, iterate an array of text, possibly change some spacing, print text, loop.
Can anyone explain this or know how to fix it?