Converting a document with media inside, into a pdf

Hi There,

We would like to know how to convert a document with a video inside it in to a pdf. Here with I have attached a sample document for your reference. This document has a windows media player referring to a video in a local network share. I was trying to convert it as a pdf using following snippet.

Document doc = new Document(“Claim-000029_1.docx”);
com.aspose.words.PdfSaveOptions options = new com.aspose.words.PdfSaveOptions();
options.getOutlineOptions().setHeadingsOutlineLevels(3);
options.getOutlineOptions().setExpandedOutlineLevels(1);
doc.save(“Claim-000029_1.pdf”,options);

But the out put pdf does not have the media player icon or the video in it. Request you to help us to convert this document to pdf.

Thanks,
Manikandan
Claim-000029_1.zip (295.9 KB)

@Mani_Alagappan,

We have converted your ‘Claim-000029_1.docx’ document to PDF format by using Aspose.Words for Java 19.3 and MS Word 2019 and attached them here for your reference (see awjava-19.3.pdf (235.2 KB) and msw-2019.pdf (553.0 KB)). In this case, the latest version of Aspose.Words for Java mimics the way the Microsoft Word works. Please upgrade to latest version and see how it goes on your end. Hope, this helps.

Hi There,

I tried with the latest Aspose Words 19.3 for Java version. Now I see the Windows Media Player image inside the pdf and it shows as “Connecting”. But I am not able to play or do anything in it as it is rendered like an image and not as video. Please find attached the sample screenshot and the generated pdf for reference.

Also I would like to know is it possible to dynamically embed/insert a video in the local drive, inside a word or pdf. If so, can you please send me some code snippet?

Claim-000029_1.pdf (226.5 KB)
2019-03-14_09h16_23.png (19.7 KB)

Thanks,
Manikandan

@Mani_Alagappan,

But, this is how MS Word 2019 also works; i.e.you will not be able to play the video even inside the MS Word 2019 generated PDF.

Secondly, to be able to insert an online video object into the Word document, please check different overloads of DocumentBuilder.InsertOnlineVideo Method.