We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Can we have special characters along with page number in dot net Aspose word?

Hi Team,

We have a requirement where page number needs to be displayed like this “-1-” in dot net Aspose word. I am not sure if this is feasible at first place. could please confirm if this could be achieved in Aspose word and if yes kindly share a sample code snippet as well.

Thanks & Regards

@Karthik_Test_account Sure, you can achieve this by setting PageSetup.PageNumberStyle value to NumberStyle.NumberInDash. For example see the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.PageSetup.PageNumberStyle = NumberStyle.NumberInDash;
builder.InsertField(FieldType.FieldPage, true);

Thank you !!! This works :slight_smile:

1 Like