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

Free Support Forum - aspose.com

Set size of an empty Paragraph not working

Hi,


I have an empty Paragraph (paragraph.hasChildNodes is false). When I try to set its size as follows :

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} span.s1 {color: #7e504f}

p.getParagraphFormat().getStyle().getFont().setSize(10);


and then do the following :


p.getParagraphFormat().getStyle().getFont().getSize();


It does return 10. But when the document is generated, it remains to its original size (12).

When I add a Run with a blank to the paragraph, everything works fine.

Could this be a bug, or is it not possible to set a size to an empty paragraph ?


greetings,

C.

Hi Steve,

Thanks for your inquiry. Please use Paragraph.ParagraphBreakFont property to access to the font formatting of the paragraph break character. Please use this property to set the font size. Hope this helps you.

If you still face problem, please share your input and expected output documents here for our reference. We will then provide you more information about your query.

Thanks Tahir, that works for me !