I am having a xml file which internally embedded with another xls file as a link.(attached here) .Now i have to generate a pdf of this xls file with the embedded file. How can I do this ?
Sample code :
String fileName="C:\\Test\\Book2.xlsx"
Workbook exl = new Workbook();
exl.open(fileName);
exl.save(pdfFileName, FileFormatType.PDF);
If I am doing like this the embedded file is not coming as a part of the generated Pdf.
Thanks for your interest in Aspose.Cells for Java.
In .NET version, there is a property OleObjects, which give you access to embedded objects. But I am not finding it in Java version. So it seems to me a new feature.
I have added it as a New Feature Request with id: CELLSJAVA-29103
I think you may try to extract the OLE Objects from the Excel files, The Ole Objects are represented as Shapes in the sheet, see the document for your complete reference:
For embedded excel file in excel97-2003 template file, please follow our previous reply of Amjad.
For excel2007 template file, currently we do not support to parse the embedded object into our OleObject model. So for this given template file “container.xlsx”, you cannot get the OleObject instance from the shapes collection.
We need to make further investigation to check whether we can support to parse OleObject from xlsx template file.
Hey, This is working in 97-2003 version but the oles.get(i).getType() is coming as 8 i.e. MsoDrawingType.PICTURE. I have attached a 97 version xls file as embedded.
Any idea why its not coming as MsoDrawingType.OLE_OBJECT i.e. 24.
As we told you in previous reply, for Excel2007 template file, currently we do not support to parse the embedded object into ourOleObject model. So for this given template file“container.xlsx”, you cannot get theOleObjectinstance from the shapes collection.
We need to make further investigation to check whether we can support to parseOleObject fromxlsx template file.
Updated:
Also, if you found the component cannot recognize
OleObjects in XLS template file, please post the template file and we will check
it soon.<o:p></o:p>
Please see the code below and the source.xls attached by me. It contains an embedded xls file. The code extracts the embedded xls file and write it as source.xls.out-0.xls
I have attached both the source and output xls files.