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

Free Support Forum - aspose.com

Problem with reading bullted content in Presentation

Hi Team,

Using the below sample code, I have created a presentation for Managing Paragraph Bullets in PPTX.
When i open pptx, it prompts to repair the presentation with following message:

"Powerpoint found a problem with content in :…pptx.Powerpoint can attempt to repair the presentation.
Powerpoint couldn’t read some content in Bullet."

I am using 14.9.0.0 version of Aspose.slides for .Net and opening presentation in PowerPoint 2013.
I have zipped up and attached the presentation.

Code:

//Creating a presenation instance
using (Presentation pres = new Presentation())
{
<span class="code-comment">//Accessing the first slide

ISlide slide = pres.Slides[0];

<span class="code-comment">//Adding and accessing Autoshape

IAutoShape aShp = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 200, 200, 400, 200);

<span class="code-comment">//Accessing the text frame of created autoshape

ITextFrame txtFrm = aShp.TextFrame;

<span class="code-comment">//Removing the <span class="code-keyword">default</span> exisiting paragraph

txtFrm.Paragraphs.RemoveAt(0);

<span class="code-comment">//Creating a paragraph

Paragraph para = new Paragraph();

<span class="code-comment">//Setting paragraph bullet style and symbol

para.ParagraphFormat.Bullet.Type = BulletType.Symbol;
para.ParagraphFormat.Bullet.Char = Convert.ToChar(8226);

<span class="code-comment">//Setting paragraph text

para.Text = “Welcome to Aspose.Slides”;

<span class="code-comment">//Setting bullet indent

para.ParagraphFormat.Indent = 25;

<span class="code-comment">//Setting bullet color

para.ParagraphFormat.Bullet.Color.ColorType = ColorType.RGB;
para.ParagraphFormat.Bullet.Color.Color = Color.Black;
para.ParagraphFormat.Bullet.IsBulletHardColor = NullableBool.True; // set IsBulletHardColor to true to use own bullet color

//Setting Bullet Height
para.ParagraphFormat.Bullet.Height = 100;

<span class="code-comment">//Adding Paragraph to text frame

txtFrm.Paragraphs.Add(para);

<span class="code-comment">//Creating second paragraph

Paragraph para2 = new Paragraph();

<span class="code-comment">//Setting paragraph bullet type and style

para2.ParagraphFormat.Bullet.Type = BulletType.Numbered;
para2.ParagraphFormat.Bullet.NumberedBulletStyle = NumberedBulletStyle.BulletCircleNumWDBlackPlain;

<span class="code-comment">//Adding paragraph text

para2.Text = “This is numbered bullet”;

<span class="code-comment">//Setting bullet indent

para2.ParagraphFormat.Indent = 25;

para2.ParagraphFormat.Bullet.Color.ColorType = ColorType.RGB;
para2.ParagraphFormat.Bullet.Color.Color = Color.Black;
para2.ParagraphFormat.Bullet.IsBulletHardColor = NullableBool.True; <span class="code-comment">// set IsBulletHardColor to <span class="code-keyword">true</span> to use own bullet color
//Setting Bullet Height para2.ParagraphFormat.Bullet.Height = 100;
<span class="code-comment">//Adding Paragraph to text frame

txtFrm.Paragraphs.Add(para2);

<span class="code-comment">//Writing the presentation as a PPTX file

pres.Save(“Bullet.pptx”, SaveFormat.Pptx);

}



Hi Pradeep,

Thank you for the details.

I am able to reproduce your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: SLIDESNET-35961. You will be notified via this forum thread once the issue gets resolved.

Thanks & Regards,

Hi Owais,


Do you mean to say, there is no way to add bullets and numbering in presentation using Aspose.slides for .Net because sample code for the same given by Aspose is not working. Please confirm.

Is there any alternative to add bullets and numbering in presentation? If yes, please provide sample code for the same. It would be a great help for me to go ahead with Aspose.slides for .Net.

Thank you.

Pradeep

Hi Pradeep,

Well, the feature is supported by Aspose.Slides for .NET. I have further checked the issue and there is some issue with number bullet styles. Some number formats are not working properly with the latest version. Please try the following updated code to add bullets and number bullets.


//Creating a presenation instance
using (Presentation pres = new Presentation())
{

//Accessing the first slide
ISlide slide = pres.Slides[0];

//Adding and accessing Autoshape
IAutoShape aShp = slide.Shapes.AddAutoShape(Aspose.Slides.ShapeType.Rectangle, 200, 200, 400, 200);

//Accessing the text frame of created autoshape
ITextFrame txtFrm = aShp.TextFrame;

//Removing the default exisiting paragraph
txtFrm.Paragraphs.RemoveAt(0);

//Creating a paragraph
Paragraph para = new Paragraph();

//Setting paragraph bullet style and symbol
para.ParagraphFormat.Bullet.Type = BulletType.Symbol;
para.ParagraphFormat.Bullet.Char = Convert.ToChar(8226);

//Setting paragraph text
para.Text = “Welcome to Aspose.Slides”;

//Setting bullet indent
para.ParagraphFormat.Indent = 25;

//Setting bullet color
para.ParagraphFormat.Bullet.Color.ColorType = Aspose.Slides.ColorType.RGB;
para.ParagraphFormat.Bullet.Color.Color = System.Drawing.Color.Black;
para.ParagraphFormat.Bullet.IsBulletHardColor = NullableBool.True; // set IsBulletHardColor to true to use own bullet color

//Setting Bullet Height
para.ParagraphFormat.Bullet.Height = 100;

//Adding Paragraph to text frame
txtFrm.Paragraphs.Add(para);

//Creating second paragraph
Paragraph para2 = new Paragraph();

//Setting paragraph bullet type and style
para2.ParagraphFormat.Bullet.Type = BulletType.Numbered;
para2.ParagraphFormat.Bullet.NumberedBulletStyle = NumberedBulletStyle.BulletArabicPeriod;
para2.ParagraphFormat.Bullet.NumberedBulletStartWith = 1;

//Adding paragraph text
para2.Text = “This is numbered bullet”;

//Setting bullet indent
para2.ParagraphFormat.Indent = 25;

para2.ParagraphFormat.Bullet.Color.ColorType = Aspose.Slides.ColorType.RGB;
para2.ParagraphFormat.Bullet.Color.Color = System.Drawing.Color.Black;
para2.ParagraphFormat.Bullet.IsBulletHardColor = NullableBool.True; // set IsBulletHardColor to true to use own bullet color

//Setting Bullet Height
para2.ParagraphFormat.Bullet.Height = 100;

//Adding Paragraph to text frame
txtFrm.Paragraphs.Add(para2);

//Saving the presentation as a PPTX file
pres.Save(“d:\data\Bullet.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);

}

Some of the number bullet formats are causing the issue and our development team will further look into them. Please feel free to contact support in case you need any further assistance.

Thanks & Regards,

Thank you Owais for the quick response.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.