Extract Speaker notes from PPT and PPTX

Please provide the sample code to extract speaker notes from ppt and pptx files.

Hi Ponraj,

I have observed your requirements and please use the following source code to serve the purpose. Please share, if I may help you further in this regard.

PresentationEx pres = new PresentationEx("D://ppt//notext.pptx");

//Access the first slide
SlideEx sld = pres.Slides[0];

//Creating Slide note instance
NotesSlideEx note = sld.NotesSlide;

//Casting to autoshape
AutoShapeEx shp1 = (AutoShapeEx)note.Shapes[1];

//Accessing autoshape’s text frame
TextFrameEx txt1 = shp1.TextFrame;

//Extracting Slide notes
MessageBox(txt1.Text);

//Updating Slide notes
txt1.Text = "Text has Changed";

pres.Write("D://ppt//notext.pptx");

Many Thanks,

Thanks.

How to do for PPT files?

PPTX: why we want hardcode as 1 in the below line:

AutoShapeEx shp1 = (AutoShapeEx)note.Shapes[1];

Also from the above sample code I'm not able to retrive the spekaer notes. I have tried with the below code:

SlideEx slide;

for (int slidecnt = 1; slidecnt < presentation.Slides.Count; slidecnt++)

{

slide = presentation.Slides[slidecnt];

NotesSlideEx notes = slide.NotesSlide;

if (notes != null)

{

ShapeExCollection shapes = notes.Shapes;

foreach (AutoShapeEx shape in shapes)

{

//Accessing autoshape's text frame

TextFrameEx text = shape.TextFrame;

if (text != null && text.Text != string.Empty)

return true;

}

}

}

PPTX: Even if the speaker notes are not there,it is trying to read junk text <#> for the above sample code.

Hi Ponraj,


Please use the following code snippet for reading PPT slide notes. I also like to add that the notes slides has 3 shapes in its shapes collection. That include one actual text frame with slide notes on index 1. While other is meta-character and having slide number inside that. The code that have used is fine as well.

public static void ReadPPTNotes()
{
Presentation pres = new Presentation(“D://Aspose Data//notext.ppt”);
//Access the first slide
Slide sld = pres.Slides[0];
//Creating Slide note instance
Notes note = sld.Notes;

ShapeCollection shapes = note.Shapes;
int s = shapes.Count;
foreach (Aspose.Slides.Shape shape in shapes)
{
if (shape.TextFrame != null)
{
//Accessing autoshape’s text frame

TextFrame text = shape.TextFrame;

if (text != null && text.Text != string.Empty)
{

//Extracting Slide notes
Console.WriteLine(text.Text);
}
}
}
}

Many Thanks,

Thanks for the updates.

What is the difference between AutoShape and Shape. I have to use which one to get the actual speaker notes?

Hi,


Actually, in case of PPT the text frame is associated to Shape class. However, in case of PPTX, the text frame is associated with AutoShapeEx. So, if any shape is of AutoShapeEx type in PPTX then it means the shape has text inside it.

Many Thanks,

Thanks for the updates.

Currently I'm using 5.7.0.0 version of Aspose.Slides.dll. Can you please provide me the link to download the latest version of slides dll.

Thanks,

Ponraj.M

Hi Ponraj. M,


Please download the latest version of Aspose.Slides for .NET 6.8.0 from this link.

Many Thanks,

Hi,

I'm trying to retrieve the notes text as well as notes format from the source PPTX slide and trying to add it in new slide. Using Aspose.Slides 6.8

I could able to get the notes and paragraph formats like indent. I have applied the fontBold,fontItalic,FontUnderline. .Though it is returning the value as False.

Please find the attached code and help me to resolve the issue.

Thanks,

Ponraj.M

Hi Ponraj.M,


I have verified the sample code and it is in fact the same as shared over this documentation link. You need to copy the paragraphs as well in your sample code for indent properties. Please try using Aspose.Slides for .NET 7.4.0 on your end and if there is still an issue then please share the sample application along with source and generated presentation. I will investigate the issue further on my end to help you out.

Many Thanks,

Hi,

Even I said that I could able to get the indent properly. I have avided copyparagraph becuase the code will be too lengthy :). But I am unable to get the properties like font bold,italic,underline,strikethrough etc.I think using 7.4.0 will not resolve this issue as this is the basic settings which should work. I think I misssed something.

Did you able to reproduce this issue. Kindly help me to resolve the same.

Thanks,

Ponraj.M

Hi Ponraj.M,


As I requested you in my earlier post to kindly share the sample application along with source and generated presentation for further investigation on my end. When you will share the requested information, I will investigate the issue further on my end to help you out.

Many Thanks,

A post was split to a new topic: How to Extract Speaker Notes with Aspose.Slides for Java?