Hi
Thanks for
your request. Try to use the following code.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
//create header
HeaderFooter header = new HeaderFooter(doc, HeaderFooterType.HeaderPrimary);
Paragraph paragraph = new Paragraph(doc);
Run run = new Run(doc);
run.Text = "Header";
paragraph.AppendChild(run);
header.AppendChild(paragraph);
builder.InsertBreak(BreakType.PageBreak);
//insert section break
builder.InsertBreak(BreakType.SectionBreakNewPage);
//add header to current section
builder.CurrentSection.HeadersFooters.Add(header);
builder.InsertBreak(BreakType.PageBreak);
doc.Save(@"257_98196_jonathanh\out.doc");
This code
will create document that contains four pages. First and second pages doesn’t
have a header and third and forth has a header.
I hope that
it will help you.
Best
regards.