Cannot display bullet in new Paragraph (Trial version)

Hi all,

currently I’m evaluating Aspose.Slides for Java. What I want to do is to add new Paragraph objects to a TextFrame.

What I’m able to do is to change the bullet character or to (un)hide the bullet via the setHasBullet(…) method, as long as I’m calling the methods on a Paragraph object which already exists in the PPT file (obtained via shape.getTextFrame().getParagraphs().get(i)).

However when I create a new Paragraph object via the following code and add it to the TextFrame (getParagraphs.add(par)), the bullet is never shown:

Paragraph par = new Paragraph();
par.setAlignment(TextAlignment.LEFT);
par.setText(“new Paragraph”);
par.setHasBullet(true);
par.setBulletCharacter("=".charAt(0));
par.setBulletColor(new Color(137, 137, 137));

The call of the methods setHasBullet(true) and setBulletColor(…) seem to have no effect at all, since when I call getBulletColor() and getHasBullet() later on, I get the return values Color(0, 0, 0) for bullet color and false for hasBullets.

Am I missing something, or could this be a restriction in the free trial versions? (I tried versions 2.7.0 and 2.6.0).

If the latter is the case, are there other restrictions, and what are they?

Thank you very much in advance.


Kind Regards
Stefan



Hi Stefan,


I have worked over the issue shared by you. I like to share that before applying the bullet properties you need to add the generated paragraph in Text Frame. For your kind reference, I have shared the sample code and generated presentation. I have used Aspose.Slides for Java 2.7.0.

Presentation pres=new Presentation();
Slide slide=pres.getSlideByPosition(1);
//Adding new shape and removing all paragraphs inside its text frame
com.aspose.slides.Shape shape=slide.getShapes ().addRectangle(200,200,800,600);
TextFrame txtFrm=shape.addTextFrame (“Hi thre”);
txtFrm.getParagraphs ().removeAt (0);
Paragraph para1 = new Paragraph();
para1.setAlignment(TextAlignment.LEFT);
para1.setText(“new Paragraph”);
txtFrm.getParagraphs().add(para1);
para1.setBulletType(BulletType.SYMBOL);
para1.setBulletCharacter("=".charAt(0));
para1.setHasBullet(true);
para1.setBulletColor(new java.awt.Color(137, 137, 137));
Paragraph para2 = new Paragraph();
para2.setAlignment(TextAlignment.LEFT);
para2.setText(“new Paragraph 2”);
txtFrm.getParagraphs().add(para2);
para2.setBulletType(BulletType.SYMBOL);
para2.setBulletCharacter("=".charAt(0));
para2.setBulletColor(new java.awt.Color(137, 137, 137));
para2.setHasBullet(true);
pres.write(“D:\Aspose Data\bullet.ppt”);

Many Thanks,

Hi,

adding the paragraph first does the trick. Now it works! Many Thanks!!

Kind Regards
Stefan