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

Free Support Forum - aspose.com

Default font settings for the whole document

Hi,

Can we specify default font size and font type for the entire document using XML?

Thanks

Mamatha

Hi Mamatha,

Thanks for using our products.

In order to set the FontName and FontSize for for entire document, please specify the information on Section tag. Please take a look over following sample.


Hi,

I specified fontsize and name at section level. It worked.

I have to a table with one row in the template. When I add rows to it dynamically font size is getting defaulted to 12 point. But I have sepcified as 10 in the section. I tried to set at cell level also. It did not work.

Text ereq = new Text(section);
ereq.getTextInfo().setFontSize(10);

Segment seg = new Segment(ereq);
seg.setContent("123");
Cell cell1 = row1.getCells().add();
cell1.getParagraphs().add(seg);

Can you please tell the right way of accomplising it.

Thanks

Mamatha

Hi Mamatha,

Thank you for the sample code. You may check the following documentation link for details and code snippets as per your requirement. You can set different Font Size for each Segment.

Text Formatting

Please do let us know if you need any further assistance.

Thanks & Regards,