Free Support Forum - aspose.com

setBulletCharacter

I have a development site and a live site. When calling the funtion setBulletCharacter('>') it is giving me a "The value ">" cannot be converted to a number". According to the documentation, i shoudl be able to pass it a char value to use. The function works on our development server and not on the live.

Thanks!


This message was posted using Aspose.Live 2 Forum

Dear mmclain,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for considering Aspose.Slides for JAVA.

Are you setting the Paragraph.setBulletType to symbol?

Paragraph para = tf.getParagraphs().get(0);

para.setHasBullet((short)1);

para.setBulletType(BulletType.SYMBOL);

para.setBulletCharacter('>');

Here is a complete code in JAVA, please also see the output presentation attached by me.

JAVA CODE:

---------------------------------------------------------------------------------------------

Presentation pres = new Presentation();

Slide sld = pres.getSlideByPosition(1);

com.aspose.slides.Rectangle rect = sld.getShapes().addRectangle(300, 300, 3000, 1);

rect.getLineFormat().setShowLines(false);

TextFrame tf = rect.addTextFrame("This is first paragraph.");

tf.setWrapText(true);

tf.setFitShapeToText(true);

Paragraph para = tf.getParagraphs().get(0);

para.setHasBullet((short)1);

para.setBulletType(BulletType.SYMBOL);

para.setBulletCharacter('>');

Paragraph newPara = new Paragraph(para);

newPara.getPortions().get(0).setText( "This is second paragraph.");

tf.getParagraphs().add(newPara);

pres.write(new FileOutputStream("c:\\out.ppt"));

Here is the code that I am using in ColdFusion’s cfscript:
paragraph = createObject(“java”,“com.aspose.slides.Paragraph”);
paragraph.setText(replace(paragraphArray[i], chr(10), “”, “ALL”));
portion = paragraph.getPortions().get(0);
paragraph.setHasBullet(1);
greenColor = createObject(“java”, “java.awt.Color”).init(javaCast(“int”,85),javaCast(“int”,136),javaCast(“int”,0));
paragraph.setBulletColor(greenColor);
paragraph.setBulletHeight(100);
paragraph.setBulletType(1);
paragraph.setBulletCharacter(’>’);
portion.setFontColor(Color.black);
portion.setFontHeight(15);
slide.getShapes().get(1).getTextFrame().getParagraphs().add(paragraph);

I am still getting the same error. I am setting the bullet type to 1 which is Symbol.

It works now. I took the call out for the set bullet type and set bullet character and the everything appears as needed now since all I was doing was replacing the text that was already there. But I did notice that I have 4 slides that for some reason when cloned put borders around the text frames when in the original there were none. What would be causing this? It is happening between slides 40 - 42 and it doesn’t matter which slide is put there it is the same thing each time.

Thanks!