有没有哪位大侠做过类似的方法啊,麻烦告知小弟下。万分感谢。

解决方案 »

  1.   

    安装office2007,有自带方法 SaveAsPdf
      

  2.   

    呵呵,建议你转换为xps试试。
      

  3.   

    基本上就是调用相应的Office(对于Word、Excel、PPT不同)的COM接口,执行其保存操作。例如:var app = new Microsoft.Office.Interop.Excel.Application();
    var doc = app.Workbooks.Open(file);
    var target = Path.GetTempFileName();
    doc.SaveAs(target, Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypeXPS);
    app.Quit();和var app = new Microsoft.Office.Interop.Word.Application();
    var doc = app.Documents.Open(file);
    var target = Path.GetTempFileName();
    doc.SaveAs2(target, Microsoft.Office.Interop.Word.WdExportFormat.wdExportFormatXPS);
    app.Quit(Microsoft.Office.Interop.Word.WdSaveOptions.wdDoNotSaveChanges);对于PPT也是一样的。
      

  4.   

    1、安装“Foxit PDF Printer”打印机
    2、程序中打印输出到“Foxit PDF Printer”打印机。