Free Support Forum - aspose.com

SlidesEx.Placeholders missing in 7.1

Hi,


I am using Aspose.Slides for .NET version 7.1.

I am using Aspose.Slides.Pptx namespace for accessing .pptx files. I could not find the property Placeholders in the class Aspose.Slides.Pptx.SlideEx.

I could find the same property when I am previously using the namespace Aspose.Slides.

Please help, I am badly stuck.

Regards,
Nilotpal Saha

Hi,


How will I access the placeholders in a single slide. I am using Aspose.Slides 7.1. Please help

Regards,
Nilotpal Saha

Hi Nilotpal Saha,

I have observed your requirements and like to share that you are using old out dated API that is no longer supported. We have shared the new merged Aspose.Slides for .NET API since December 2013 and support for old legacy is no longer available. Therefore, I request you to please try using Aspose.Slides for .NET 14.10.0 on your end which is the latest API to date. There is support for identifying the shapes based on their placeholder types. The placeholder is in fact not an actual shape but a template abstract shape that keeps information that this placeholder will have become a desired shape when used. Like Placeholder types Title or Body are in actual Autoshapes. The chart placeholder become a shape of chart type when eventually used. The following sample code will illustrate you how to identify the shapes based on their placeholders.

public static void getText()
{
String path = @“D:\Aspose Data”;
Presentation pres = new Presentation(path + “Test.pptx”);

ISlide slide = pres.Slides[0];

if (slide != null)
{
foreach (IShape shape in slide .Shapes)
{
if (shape is IAutoShape && shape.Placeholder.Type==PlaceholderType.Body)
{
IAutoShape ashp = (IAutoShape)shape;

if (ashp.TextFrame != null)
{
String text = ashp.TextFrame.Text;
}
}
}
}

}

I hope the shared information will be helpful. Please share, if I may help you further in this regard.

Many Thanks,

Hi,


I am trying to access a .pptx file with the Syntax you mentioned above in your reply. However, I’m getting an error "The file is ZIP archive. It can be Microsoft PowerPoint 2007 PPTX presentation."
What do I do?


Regards,
Nilotpal Saha

Hi Nilotpal Saha,

You are getting the issue because you may probably be using the old API. As suggested earlier please use Aspose.Slides for .NET 14.10.0 on your end with above code. If there is still issue then please share the sample presentation causing the issue and I will investigate that on my end.

Many Thanks,

Hi,


My team purchased the license for Aspose.Total 7.0 on March 2013. Currently we are not in a position to purchase a new version again, just because the purchased version is unable to perform on .pptx file. Please suggest me an alternative solution instead of purchasing a new license.

Regards,
Nilotpal Saha

Hi Nilotpal Saha,

I have observed your requirement and I like add here is that the version for which you are requesting support is no longer supported. You can try using the following alternative approach on your end with Aspose.Slides version you are using. But if there is any issue in API version that you are using that cannot be fixed in the version you are using. In that case you will have to switch to new version in order to get the fix as things are verified and resolved on the basis of latest availble version to date. If there is no issue in latest availble version then issue shared by customer can no longer be considered as an issue as it is working with latest release. I hope this will clarify the concept.

public static void getText()
{
String path = @“D:\Aspose Data”;
PresentationEx pres = new PresentationEx(path + “Test.pptx”);

SlideEx slide = pres.Slides[0];

if (slide != null)
{
foreach (ShapeEx shape in slide.Shapes)
{
if (shape is AutoShapeEx && shape.Placeholder.Type == PlaceholderTypeEx.Body)
{
AutoShapeEx ashp = (AutoShapeEx)shape;

if (ashp.TextFrame != null)
{
String text = ashp.TextFrame.Text;
}
}
}
}

}

Many Thanks,

Hi,


Thank you so much for your reply. Your piece of code helped me. However, I have another query. I have a requirement of accessing a picture in a slide and replacing it with another picture saved in a local path. I am still using the namespace Aspose.Slides.Pptx and Aspose.Slides V7.1. Please help me out here,

Regards,
Nilotpal Saha

Hi Nilotpal Saha,

I have observed your requirements and suggest you to please visit this thread post that contain the exact sample code to meet your requirements. I hope this will be helpful. Please share, if I may help you further in this regard.

Many Thanks,

Hi Mudassir,


Thank you so much for you quick reply. It solved my problem.

Reagrds,
Nilotpal

Hi Nilotpal,

Its good to know things are working on your end. Please share, if I may help you further in this regard.

Many Thanks,