Hi Timothy,
Thanks for the additional information.
Regarding “FX150812101621530000000000024433L25.Header on all even pages.doc”, this document has three Sections such that Section 1 has one page, Section 2 has one page and Section 3 has remaining four pages. You can create such document using following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write(“Section 1 content…”);
builder.MoveToHeaderFooter(HeaderFooterType.FooterEven);
builder.Write(“This footer content is on all even pages of document”);
builder.PageSetup.OddAndEvenPagesHeaderFooter = true;
builder.MoveToDocumentEnd();
builder.InsertBreak(BreakType.SectionBreakNewPage);
builder.Write(“Section 2 content…”);
builder.InsertBreak(BreakType.SectionBreakNewPage);
builder.Write(“Section 3 Page 1 content…”);
builder.InsertBreak(BreakType.PageBreak);
builder.Write(“Section 3 Page 2 content…”);
builder.InsertBreak(BreakType.PageBreak);
builder.Write(“Section 3 Page 3 content…”);
builder.InsertBreak(BreakType.PageBreak);
builder.Write(“Section 3 Page 4 content…”);
doc.Save(MyDir + @“15.7.0.docx”);
Regarding “FX150812101621530000000000024433L25-header Details only on page 2.doc”, this document has four Sections such that Section 1 has one page, Section 2 has one page, Section 3 has three pages and Section 4 is on the same last page. You can create such document using following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write(“Section 1 content…”);
builder.InsertBreak(BreakType.SectionBreakNewPage);
builder.Write(“Section 2 content…”);
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
builder.Write(“This Header content is only on Second page of document”);
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
builder.Write(“This Footer content is only on Second page of document”);
builder.MoveToDocumentEnd();
builder.InsertBreak(BreakType.SectionBreakNewPage);
builder.CurrentSection.HeadersFooters.LinkToPrevious(false);
builder.Write(“Section 3 Page 1 content…”);
builder.InsertBreak(BreakType.PageBreak);
builder.Write(“Section 3 Page 2 content…”);
builder.InsertBreak(BreakType.PageBreak);
builder.Write(“Section 3 Page 3 content…”);
builder.InsertBreak(BreakType.SectionBreakContinuous);
doc.Save(MyDir + @“15.7.0.docx”);
I hope, this helps.
Best regards,