已经安装了pdf creator,就是如何调用其相应的虚拟打印接口,将word文档转换成pdf啊?

解决方案 »

  1.   

    UseOffice .Net 万能文档转换器
      

  2.   

    安装Word,以及支持PDF输出的虚拟打印机。
    用Process.Start调用winword /p "x:\yourpath\xxx.doc"。
      

  3.   

    office 2007里的word可以直接将word文件另存为pdf文件,在代码里调用word的com组件然后再调用另存为功能就OK了,用打印机打出来文件会变的很大。
      

  4.   

      public void GeneratePDF(string wordfile, string pdffile)
            {
                PDFMakerAppClass pdfMaker = new PDFMakerAppClass();
                pdfMaker.CreatePDF(wordfile, pdffile, PDFMakerSettings.kConvertAllPages, false, false, false, null);
            }  string testFilePath = Path.GetFullPath(System.Windows.Forms.Application.StartupPath + "..\\..\\..\\TestWord\\129757616112968750.doc");            string tt = Path.GetFullPath(System.Windows.Forms.Application.StartupPath + "..\\..\\..\\TestWord");
                if (File.Exists(testFilePath))
                {
                    GeneratePDF(testFilePath, tt+"\\test0311.pdf");
                }
    调用后,也没有显示错误,但是,找不到转换后的pdf文件,也不知道是否转换成功,是怎么回事?
      

  5.   


    在win 2003 server环境下就可以正常转换,pdfMaker.CreatePDF的返回值是0,win xp就出现问题,pdfMaker.CreatePDF的返回值是-10。
      

  6.   

    可以用PDFNet,这个开发包很好用,转出来的效果也不错,而且可以转多种格式。
      

  7.   

    好的,去试验一下。支持FrameWork 2.0吧