背景1:ASP.NET 下在线ppt转Pdf ,我的实现方法是引用com组件的方式去实现。目前一般的ppt是可以实现转pdf的。主要实现代码   
public static bool PPTToPdf(string sourcePath, string targetPath, PpSaveAsFileType targetFileType)
        {
            bool result;
            object missing = Type.Missing;
            ApplicationClass application = null;
            Presentation persentation = null;
            try
            {                
                application = new ApplicationClass();
                persentation = application.Presentations.Open(sourcePath, MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);
                persentation.SaveAs(targetPath, targetFileType, Microsoft.Office.Core.MsoTriState.msoTrue);                result = true;
            }
}
当转换有一些ppt时报如下异常“ 存储此文件时发生错误”。
背景2:该ppt我在用office2007打开的时候,选择另存为pdf的时候,在转换的过程中报错“ 存储此文件时发生错误”,网上我搜了下说问题的原因是ppt使用的字体样式在pdf中不存在,不能转换。
我的Ppt里面图片比较多的,我想问下这种情况应该怎么处理? 告诉我直接在word里面转成功的方法也行,还有如果在.NET里面应该怎么去解决这个问题?背景3(可选):我用C#代码检测了下 我的原ppt使用的字体都是pdf包括的系统字体。(也有可能我的检查代码写的不正确)
 List<string> _fontNames = new List<string>();
                foreach (PowerPoint.Slide slide in persentation.Slides)
                {
                    foreach (PowerPoint.Shape shape in slide.Shapes)
                    {
                        if (shape.HasTextFrame ==MsoTriState.msoTrue &&
                            shape.TextFrame.HasText == MsoTriState.msoTrue)
                        {
                            PowerPoint.TextRange textRange = shape.TextFrame.TextRange;
                            for (int i = 0; i < textRange.Length; ++i)
                            {
                                PowerPoint.Font font = textRange.Characters(i, 1).Font;                                if (!_fontNames.Contains(font.Name))
                                    _fontNames.Add(font.Name);
                            }
                        }
                    }
                }

解决方案 »

  1.   

    虚拟打印即可。三种虚拟打印方式:一是用WPS2007以下版本,二是用acrobat,三是直接安排PDF虚拟打印机。
      

  2.   

    有专门软件可以转换的,像word转ppt  word转pdf一样,你网上搜一下吧 
      

  3.   

    因为我的代码用的是office组建去实现改功能的,,,所以我应该先解决office(2007)下怎么实现这个缺陷
      

  4.   

    使用Flashpaper去转换就可以了。
    http://topic.csdn.net/u/20120717/07/55bb1837-07a7-465b-bc88-895a7c45882a.html
    我这里是使用它转换成SWF文件 同理这个第三方也可以将文件转换成PDF.