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

Free Support Forum - aspose.com

How to extract the videos from this pdf?

Hi, Support:
Please download the demo pdf file at :https://mail.163.com/large-attachment-download/index.html?p=X-NETEASE-HUGE-ATTACHMENT&file=LnKtB3E1T3Ojd5ahmWiydSsPsCOcRbxpB2zw6lYurK2CnN2XKyuuYn-GnFTVrMeFgkCSrMlEORA-rERkdw4CEA&title=123
for your investigation how to extract all the embedded videos in this pdf.
Thanks!

@ducaisoft

You can use following code example to extract the embedded file from PDF.

Document pdfDocument = new Document(dataDir + "input.pdf");
// Get particular embedded file
FileSpecification fileSpecification = pdfDocument.EmbeddedFiles[1];
byte[] fileContent = new byte[fileSpecification.Contents.Length];
fileSpecification.Contents.Read(fileContent, 0, fileContent.Length);

If you still face problem, please share simple input PDF having small size. We will investigate the issue and provide you more information on it.

Thanks for your reply.
Would you please write the demo code as VB.net? I failed to convert it in to VB.net code.
And the demo pdf has attached as the above mentioned link. You must download it and investigate that given pdf file to work how to extract the embedded videos. If you use another pdf file ,the issue maybe not occur.

@ducaisoft

Please spare us some time for the investigation of this issue. We will get back to you soon.

@ducaisoft

We have logged this problem in our issue tracking system as PDFNET-51815. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi, Support:
I found a method to extract the videos from pdf, that’s is to say, extracting the videos as audio-extracting mode, and then rename the extracted audio as video file.

@ducaisoft

Have your problem solved? Could you please the code example that you are using to extract the videos from PDF?

Yes! As for the sample pdf file, I extracted all the videos as audios, and then rename audio as video, this alternative method can solve my issue, but it is not the correct method to directly extract videos from pdf.

As for an audio file ,whose file size maybe usually less than 10Mb, whereas if the file size of an extracted audio exceeds 5Mb or 10Mb, it should be a video file, so rename it as video file.

                    For Each annotation As Aspose.Pdf.Annotations.Annotation In MyPdf.Pages(ii).Annotations
                        If (annotation.AnnotationType = Aspose.Pdf.Annotations.AnnotationType.Movie Or annotation.AnnotationType = Aspose.Pdf.Annotations.AnnotationType.RichMedia) Then
                            AuDs = AuDs + 1
                        End If
                    Next

@ducaisoft

We have logged this problem in our issue tracking system as PDFNET-51835. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.