[英]Getting corrupted file error while trying to open Microsoft Powerpoint file using C#
使用C#打開ppt文件時出現損壞的文件錯誤
public void Slide()
{
string dataDir = Path.GetFullPath(@"C:\Users\Vipin\Desktop\");
using (PresentationDocument doc = PresentationDocument.Open(dataDir + "Android.ppt", true))
{
// Insert other code here.
}
}
錯誤是
從我在MSDN上看到的內容來看,PresentationDocument來自OpenXML SDK,是嗎? 如果是這樣,則僅支持使用PresentationML格式的OpenXML文檔。
文件上的.ppt
擴展名(而不是.pptx
)表明它是較舊的二進制格式,不支持。 作為測試,將文件副本另存為.pptx
然后查看是否.pptx
。
您已經在評論中提到了使用Aspose的成功。 Aspose Slides確實支持舊的二進制格式,這將為我的理論提供證據。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.