OleObject is not opening in word document

InputStream ins = connection.getInputStream();
docBuilder.insertOleObject(ins, "AcroExch.Document.7", true, null);

I tried above code to add Pdf file in word document. But pdf file in word doc is not opening
and it showing as below in word document

@jai25 can you please attach the object that you are trying to insert in the document for testing.

tmptempPdf.pdf (5.1 MB)

1 Like

@jai25 Unfortunately, the problem is not reproducible. We have used the following code for testing:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
    
InputStream ins = new ByteArrayInputStream(Files.readAllBytes(Paths.get("C:\\Temp\\OleObject.pdf")));
builder.insertOleObject(ins, "AcroExch.Document.7", true, null);

doc.save("C:\\Temp\\out.docx");

FYI @eduardo.canal

Could you please check this with aspose.word version 16.11.0

@jai25 The problem is not reproducible using 16.11 version of Aspose.Words for Java. Here is the output document produced by 16.11 version on my side: out.docx (5.1 MB)