Hi,
I was reading the documentation http://www.aspose.com/docs/display/wordsjava/Font and specifically, the following example:
Can you please tell me how do you define the MyStyle1 custom style. I can see how you use it by adding it in the Styles of the paragraph, but how you define what MyStyle1 is?Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);// Create a paragraph style and specify some formatting for it.
Style style = doc.getStyles().add(StyleType.PARAGRAPH, “MyStyle1”);
style.getFont().setSize(24);
style.getFont().setName(“Verdana”);
style.getParagraphFormat().setSpaceAfter(12);// Create a list and make sure the paragraphs that use this style will use this list.
style.getListFormat().setList(doc.getLists().add(ListTemplate.BULLET_DEFAULT));
style.getListFormat().setListLevelNumber(0);// Apply the paragraph style to the current paragraph in the document and add some text.
builder.getParagraphFormat().setStyle(style);
builder.writeln(“Hello World: MyStyle1, bulleted.”);// Change to a paragraph style that has no list formatting.
builder.getParagraphFormat().setStyle(doc.getStyles().get(“Normal”));
builder.writeln(“Hello World: Normal.”);builder.getDocument().save(getMyDir() + “Lists.ParagraphStyleBulleted Out.doc”);
Ok, maybe I’m blind!! The answer is apparent on the example you provided, but I cannot delete the current post.