I am adding the header and footer. If I add the footer it is working fine but while I am adding the header half of the data was breaking. Below is the code.
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
builder.Writeln("Header");
Header("What is Software");
builder.Font.Color = System.Drawing.Color.FromArgb(0, 132, 125);
builder.Bold = true;
builder.Font.Size = 11;
builder.Font.Name = "Calibri";
ParagraphFormat paragraphFormat = builder.ParagraphFormat;
paragraphFormat.TabStops.Add(350, TabAlignment.Left, TabLeader.None);
builder.Writeln("1, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("2, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("3, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("4, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("5, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("6, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("7, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("8, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("9, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("10, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("11, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.InsertParagraph();
builder.Font.Color = System.Drawing.Color.Black;
paragraphFormat = builder.ParagraphFormat;
paragraphFormat.ClearFormatting();
paragraphFormat.TabStops.Add(150, TabAlignment.Left, TabLeader.None);
builder.Font.Color = System.Drawing.Color.FromArgb(0, 132, 125);
builder.Bold = true;
builder.Writeln("12, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Bold = false;
builder.Font.Color = System.Drawing.Color.Black;
builder.Writeln(" " + dy + mn + yy + mm + ss);
builder.Font.Color = System.Drawing.Color.FromArgb(0, 132, 125);
builder.Bold = true;
builder.Writeln("13, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Bold = false;
builder.Font.Color = System.Drawing.Color.Black;
builder.Writeln(sDate);
builder.Write(ControlChar.LineBreak);
builder.Writeln("14, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Font.Color = System.Drawing.Color.FromArgb(0, 132, 125);
paragraphFormat.ClearFormatting();
builder.StartBookmark("MyBookmark");
builder.Writeln("15, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.Writeln("16, Computer software, or simply software, is a collection of data or computer instructions that tell the computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work.");
builder.EndBookmark("MyBookmark");
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
builder.Font.Color = System.Drawing.Color.Gray;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
builder.Font.Size = 7;
builder.Font.Bold = true;
builder.Write("Footer ");
TabStop tab = new TabStop(6.27 * 72, TabAlignment.Right, TabLeader.None);
builder.ParagraphFormat.TabStops.Add(tab);
builder.Write(ControlChar.Tab + "Page: ");
builder.InsertField(FieldType.FieldPage, false);
builder.Write(" of ");
builder.InsertField(FieldType.FieldNumPages, false);
Note:- Remove first 2 line . it’s working fine. I don’t know what is the issue. please help on this.