Hi,How can I convert an embedded file in MS Word and PPT to pdf ?
I am using Java Aspose 2.7.0.
Thanks for your inquiry. Could you please attach your input document here? I will investigate it and provide you more information.
Attaching the file.
Main file contains the Embedded file as a link inside the Main file.
Thank you for additional information. Actually there are no any embedded documents inside the attached document. There is just a linked document. In this case you can just take this linked document and convert directly to PDF using Aspose.Words.
The files can be embedded by providing a link or a icon . So, how can I get the details about the embedded files while converting the main file to pdf.
Thanks for your inquiry. Please see the attached document. There are three embedded objects inside the attached document. Simple embedded document, embedded as link and embedded as icon (show icon). You can try using the following code to extract these embedded objects and convert them to PDF.
Document doc = new Document("C:\\Temp\\Test.docx");
// Get collection of shapes
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
int i = 0;
//Loop through all shapes
foreach (Shape shape in shapes)
if (shape.OleFormat != null)
//Extract OLE object
if (shape.OleFormat.ProgId == "Word.Document.12")
MemoryStream stream = new MemoryStream();
Document newDoc = new Document(stream);
string filePath = shape.OleFormat.SourceFullName;
Document newDoc = new Document(filePath);