Hi,
I cant get text in the first slide of this ppt. Please check the issue.
Hi,
Thanks for inquiring Aspose.Slides.
I have tired to understand your requirements and have not been able to completely understand the issue. Can you please share the details about issue incurring and sample project to reproduce the issue. I am also assuming that your are using the latest version of Aspose.Slides for .NET 6.6.0 on your end as well. If you are looking for extracting text from presentation slides, please visit this technical article for your kind reference.
Many Thanks,
Actually i want to extract all text from the slide. But i couldn’t get the text from the file i attached, especially from the first slide. Please check the file and let me know it can be done.
thank you
Hi,
I have worked with the presentation file shared by you and like to share that the missing extracted text are from WordArt shapes and currently the support for WordArt is unavailable. That is why you are getting missing text for these shapes. An issue with ID SLIDESNET-32860 has already been created in our issue tracking system to provide support for WordArt shapes. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.
I have used the following code snippet on my end for my investigation.
public static void ExtractPresentationText(){String path = @“C:\Users\Mudassir\Downloads”;Presentation pres = new Presentation(path+“testppt2.ppt”);//iterate all slidesint lastSlidePosition = pres.Slides.LastSlidePosition;for (int pos = 1; pos <= lastSlidePosition; pos++){Slide sld = pres.GetSlideByPosition(pos);//iterate all shapesint shapesCount = sld.Shapes.Count;for (int shpIdx = 0; shpIdx < shapesCount; shpIdx++){Aspose.Slides.Shape shp=sld.Shapes[shpIdx];//Get the paragraphs from textholder or textframeif (shp is GroupShape){AccessGroupShape((GroupShape)shp);}else{ExtractText(shp);}}//end for}//end for}/////////public static void AccessGroupShape(GroupShape gShp){Shapes gShapes = gShp.Shapes;foreach (Shape temShp in gShapes){if (temShp is GroupShape)//recursive call to LockGroupShape if the group shape has another group shape insideAccessGroupShape((GroupShape)temShp);elseExtractText(temShp);}}public static void ExtractText(Shape shp){Paragraphs paras = null;//Check if shape holds a textholderif (shp.Placeholder != null && shp.IsTextHolder == true){//Get the place holder as an Object instanceObject obj = shp.Placeholder;//First type of place holder. It is TextHolderif (obj is TextHolder){//Cast object into TextHolder objectTextHolder txtHolder = (TextHolder)obj;paras = txtHolder.Paragraphs;//iterateParagraphs(paras, portionList);}else if (obj is Placeholder) //Second type of place holder(Shape){//Cast the object into Placeholder objectPlaceholder placeHolder = (Placeholder)obj;// getShapeRef() returns the Shape object which contains real properties of a Placeholder.paras = placeHolder.ShapeRef.TextFrame.Paragraphs;//iterateParagraphs(paras, portionList);}}else{if (shp.TextFrame != null){paras = shp.TextFrame.Paragraphs;}//if}//else//Print the text on Consoleif (paras != null){int parasCount = paras.Count;for (int paraIdx = 0; paraIdx < parasCount; paraIdx++){Paragraph para = paras[paraIdx];//print the text on console// Console.WriteLine(para.Text);Console.WriteLine(shp.TextFrame.Text);}}//end if}
We are sorry for your inconvenience,