Hi,
Could you please provide me a sample code, which demonstrate Center-Alignment in Aspose.Word.
I have a requirement, where i have to set my page heading to center.
Thanks,
Siraj
Hi
Thanks for your inquiry. Please see the following example.
// Create new document and DocumentBuilder
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Set alignment of text and other formating
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.Font.Size = 16;
builder.Font.Bold = true;
// Insert text
builder.Write("This is centered text");
// Save document
doc.Save(@"Test095\out.doc");
Also see documentation for more information.
https://docs.aspose.com/words/net/working-with-paragraphs/
Best regards.