0
我需要提取嵌入在pdf文件中的視頻文件。我可以找到註釋中的視頻,以便我不能單獨保存。我需要保存這個文件,我如何實現這一目標?如何使用iTextSharp從PDF中提取RichMediaContent
例: iTextSharp - how to open/read/extract a file attachment?
他已經提取attachement喜歡的方式,我需要提取視頻。
這裏是我的代碼:
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?
}
}
}
謝謝@Chris ... – 2012-04-25 11:25:40