Hi Komila, you can also try this
.NET Word component. Here is a simple hello world sample code how to
create and write word file in C# which will contain Hello World text, Page Break and a page number in footer:
Code:
// Create a new empty document.
DocumentModel document = new DocumentModel();
// Add document content.
document.Sections.Add(
new Section(document,
new Paragraph(document,
new Run(document, "Hello World"),
new SpecialCharacter(document, SpecialCharacterType.PageBreak))));
// Add document footer with page number.
document.Sections[0].HeadersFooters.Add(
new HeaderFooter(document, HeaderFooterType.FooterDefault,
new Paragraph(document,
new Run(document, "Page number: "),
new Field(document, FieldType.Page))));
// Save the document to a file.
document.Save("\\Document.docx");
To add you can easily
convert Word file to a PDF in C# just by saving the document with .pdf extension.