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

Free Support Forum - aspose.com

How to extract embedeed objects inside a presentation file?

how to extract .doc,.docx,.ppt,…pptx,.xls,.xlsx,.pdf embedded object inside a presentation slide using java.

Hi Anand,

Thanks for your query. Your query is more related to Aspose.Slides product. I am moving this thread to Aspose.Slides forum and my colleges will reply you shortly.

Hi Anand,


Thanks for inquiring Aspose.Slides.

Please visit this documentation link for your kind reference and share with us, if I may help you further in this regard.

Many Thanks,

what is the alternative text for .doc,.docx,.xls,.xlsx,.ppt,.pptx and .pdf .??
In the doucment link only chart object is given.
Find the OLE Object (embedded in the slide) through its Alternative
Text. Once the object is found, typecast that object as an OLE Object
Frame. This was the desired OLE Object Frame to be accessed

Hi Anand,


I like to share that Alternative Text property is actually the user defined name for any shape including Ole frames by using Aspose.Slides or PowerPoint. For more information about Alternative Text property and its usage in identifying shapes, please visit this documentation link.

I have created a sample code snippet for your reference that you can use to extract Ole frames of different types from your presentation. Please share, if I may help you further in this regard.

public static void ReadOle()
{
try {

String path=“C:\Users\Mudassir\Downloads\ExtractedOle\”;
//Load the PPTX to PresentationEx object
PresentationEx pres = new PresentationEx(path+“Embedded.pptx”);
//Access the first slide
SlideEx sld = pres.getSlides().get(0);
ShapeEx shape=null;
for(int i=0;i<pres.getSlides().size();i++)
{
sld = pres.getSlides().get(i);
for(int j=0;j<sld.getShapes().size();j++)
{
shape=sld.getShapes().get(j);
if(shape instanceof OleObjectFrameEx)
{
//Cast the shape to OleObjectFrameEx
OleObjectFrameEx oof = (OleObjectFrameEx)shape;
System.out.println(String.format("%s\t\t\t\t%s",oof.getObjectName(),oof.getObjectProgId()));
String FileType="";
if(oof.getObjectName().equals(“Worksheet”) &&oof.getObjectProgId().equals( “Excel.Sheet.12”))
{
FileType=".xlsx";
}
else if(oof.getObjectName().equals(“Worksheet”) &&oof.getObjectProgId().equals(“Excel.Sheet.8”))
{
FileType=".xls";
}
else if(oof.getObjectName().equals(“Document”) &&oof.getObjectProgId().equals(“Word.Document.12”))
{
FileType=".docx";
}
else if(oof.getObjectName().equals(“Document”) &&oof.getObjectProgId().equals(“Word.Document.8”))
{
FileType=".doc";
}
else if(oof.getObjectName().equals(“Presentation”) &&oof.getObjectProgId().equals(“PowerPoint.Show.12”))
{
FileType=".ppsx";
}
else if(oof.getObjectName().equals(“Presentation”) &&oof.getObjectProgId().equals(“PowerPoint.Show.8”))
{
FileType=".pps";
}
else if(oof.getObjectName().equals(“Acrobat Document”) &&oof.getObjectProgId().equals(“AcroExch.Document.7”))
{
FileType=".pdf";
}
else
{
FileType=".txt";
}
if (oof != null)
{
FileOutputStream fstr;
fstr = new FileOutputStream(path+“excelFromOLE_Slide_”+Integer.toString(i)+" OleIndex_"+Integer.toString(j)+FileType);
byte[] buf = oof.getObjectData();
int len=buf.length;
fstr.write(buf, 0, buf.length);
fstr.flush();
fstr.close();
// System.out.println(“Excel OLE Object written as excel1.xls file”);
}
}
}
}

} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


}

Many Thanks,

HI I could able to extract xls,xlsx,ppt,pptx,doc and docx by using above
program.Thanks for your help.But I have problem in the pdf file
extraction.I could not open the extracted pdf file.I have attached a ppt
with embedded pdf ,in the resultant output folder i could see the pdf
file but I am not able to open that pdf file.Please check that and help
me.Thank you.

Hi Anand,


I have worked with the presentation file shared. There is no issue with code snippet and I have created an issue with ID SLIDESJAVA-33406 in our issue tracking system to resolve the issue of corrupt PDF generation. I will share the further information with you as soon as it will be resolved and shared by our development team.

Many Thanks,

Could you please let me know is the issue resolved?

Hi Anand,


I regret to share that this issue has not yet been resolved. I have requested our development team to schedule the issue for investigation and will share any further information as soon as it will be shared by them.

Many Thanks,

Hi Could you please update is the issue has been resolved now?

Hi Anand,


I have verified from our issue tracking system and regret to share that the issue is still unresolved. Actually, this issue is complex and is even unresolved in Aspose.Slides for .NET as well. So, it will be first resolved in Aspose.Slides for .NET and will then be ported to Aspose.Slides for Java. We will share the good news with you as soon as it will be resolved.

We are sorry for your inconvenience,

Hi ,


Could you please update on this issue?we are waiting for long time on the issue fix?


–Anand

Hi Anand,


I like to share that the issue shared has been resolved. Please try using Aspose.Slides for Java 6.9.0 on your end and share with us if there is some issue. Please share, if I may help you further in this regard.

Many Thanks,