Slides for Java - PPTX picture bullets

Hi,

how can I create a picture bullet for PPTX ?

thx,

Florian.

Hi
Florian,


Please use the code snippet given below to serve the purpose. I have used the following code snippet to add the bullets in PPTX presentation from scratch.

//Instantiate a Presentation object that represents a PPT file
PresentationEx pres = new PresentationEx();

SlideEx slide = pres.getSlides ().get(0);

int x=slide.getShapes ().addAutoShape (com.aspose.slides.pptx.ShapeTypeEx.RECTANGLE, 100, 100, 300, 300);
AutoShapeEx aShp=(AutoShapeEx)slide.getShapes().get(x);

aShp.addTextFrame(“Hello World”);
TextFrameEx txtFrm = aShp.getTextFrame();

//Getting the first paragraph of the text frame
ParagraphEx para = txtFrm.getParagraphs().get(0);

//Enabling symbolic paragraph bullet
boolean bul= para.hasBullet ();// = true;
para.setBulletType(BulletTypeEx.SYMBOL) ;

//Setting block character as bullet
para.setBulletChar ( ‘\u25A0’);
para.setText(“Welcome to Aspose.Slides”);
para.getBulletColorFormat().setColor(java.awt.Color.BLUE);

para.getBulletColor().setColor(java.awt.Color.BLUE);

ParagraphEx para2 = new ParagraphEx();
para2.setText( “This numbered bullet”);
para2.setBulletType(BulletTypeEx.NUMBERED);


para2.getBulletColorFormat().setColor(java.awt.Color.BLUE);

para2.getBulletColor().setColor(java.awt.Color.BLUE);
para2.setNumberedBulletStyle(NumberedBulletStyleEx.BULLET_CIRCLE_NUM_WD_BLACK_PLAIN);
txtFrm.getParagraphs().add(para2);

pres.write(“d:\modified.pptx”);

If there is anything else I can do in the meantime then please let me know.


Thanks - but how can I use a custom picture instead of the symbol ?

Hi,

Thanks for using Aspose.Slides.

We regret to inform you that PictureBullet support for pptx is currently unavailable. I have observed that an issue with ID SLIDESJAVA-32872 has already been added in our issue tracking system as a new feature request. Our development team will look into the possibility of implementation of the requested feature.

This thread has been associated with this new feature request, so that you can be automatically notified as soon as this issue is resolved.

In case of ppt presentations this link will help you setting custom picture as a Picture Bullet.

We are sorry for your inconvenience,

Hi,


The issue of setting Picture Bullets for PPTX paragraphs has been resolved and Aspose.Slides for Java 2.9.0. Please use the following code snippet to serve the purpose. The mentioned release will be made available shortly.

PresentationEx presentation = new PresentationEx();
//Set the picture
BufferedImage image = ImageIO.read(new File(“Desert.jpg”));
ImageEx imageEx = presentation.getImages().addImage(image);
SlideEx slide = presentation.getSlides().get(0);
int shapeIdx = slide.getShapes().addAutoShape(
com.aspose.slides.pptx.ShapeTypeEx.RECTANGLE, 100, 100, 300, 300);
AutoShapeEx shape = (AutoShapeEx) slide.getShapes().get(shapeIdx);
shape.addTextFrame(“Image bullet demo”);
ParagraphEx paragraph = shape.getTextFrame().getParagraphs().get(0);
paragraph.setBulletType(BulletTypeEx.PICTURE);
paragraph.getBulletPicture().setImage(imageEx); //
paragraph.getPortions().get(0).setFontHeight(48);
presentation.write(“test.pptx”);


Many Thanks,

The issues you have found earlier (filed as SLIDESJAVA-32872) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(3)