I need to extract video file which is embedded in pdf file. i could find the video which is in annotation so that i can't save it separately. i need to save this file how do i achieve this?
Ex: iTextSharp - how to open/read/extract a file attachment?
he has extracted attachement like the way i need to extract the video.
here is my code:
string FileName = AppDomain.CurrentDomain.BaseDirectory + "raven test.pdf";
PdfReader pdfreader = new PdfReader(FileName);
PdfDictionary PageDictionary = pdfreader.GetPageN(1);
PdfArray Annots = PageDictionary.GetAsArray(PdfName.ANNOTS);
if ((Annots == null) || (Annots.Length == 0))
return;
foreach (PdfObject oAnnot in Annots.ArrayList)
{
PdfDictionary AnnotationDictionary = (PdfDictionary)PdfReader.GetPdfObject(oAnnot);
if (AnnotationDictionary.Get(PdfName.SUBTYPE).Equals(PdfName.RICHMEDIA))
{
if (AnnotationDictionary.Keys.Contains(PdfName.RICHMEDIACONTENT))
{
PdfDictionary oRICHContent = AnnotationDictionary.GetAsDict(PdfName.RICHMEDIACONTENT); // here i could see the video embeded but it is in annotation, how do i save this file?
}
}
}