I need to add a header to my doc(aspose.word) . Below is my code : But this doesnt work …No header is created I need the same header for all the pages
Dim st As FileStream = New FileStream(FilePath & DocumentFile, FileMode.Open) Dim doc As Aspose.Words.Document = New Aspose.Words.Document(st) doc.MailMerge.Execute(table) Dim builder As DocumentBuilder = New DocumentBuilder(doc) Dim currentSection As Aspose.Words.Section = builder.CurrentSection Dim pageSetup As Aspose.Words.PageSetup = currentSection.PageSetup pageSetup.DifferentFirstPageHeaderFooter = False pageSetup.HeaderDistance = 20 builder.PageSetup.OddAndEvenPagesHeaderFooter = False builder.MoveToHeaderFooter(Aspose.Words.HeaderFooterType.HeaderEven) builder.ParagraphFormat.Alignment = ParagraphAlignment.Center builder.Write("SAMPLE HEADER") doc.Save("aspose.word.doc", SaveFormat.Doc, Aspose.Words.SaveType.OpenInBrowser, Response)
The above code doesn’t work !!!
After this coding ,Im converting my document to a aspose.pdf(by using xml and memory stream) Will the header from the word doc be added to the pdf as well ??? or does it need a seperate coding ?
Thanks and Regards