日期:2014-05-18  浏览次数:20447 次

FlashPrinter转PDF为swf 在本地调试没任何问题 大家可能会遇到的问题。。。
方法
C# code

    public bool ConvertPdfToSwf(string inFilename, string swfFilename)
    {
        bool isStart;
        try
        {
            System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(@"D:\FlashPaper2\FlashPrinter.exe");
            startInfo.Arguments = string.Concat(Server.MapPath(inFilename), " -o ", Server.MapPath(swfFilename));
            System.Diagnostics.Process process = new System.Diagnostics.Process();
            process.StartInfo = startInfo;
            isStart = process.Start();
            process.WaitForExit();
            process.Close();
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return isStart;
    }


调用:
C# code

                    string savedocfile ="../../studyFile/PDF/" + docFile;
                    string saveswffile = "../../studyFile/PDF/" + saveswfFile;
                    bool bo= ConvertPdfToSwf(savedocfile, saveswffile);



在本地可以正常调用。。 在服务器上面没有任何反映 调用方法也返回true.. 在网上找了很多文章 但都每一个详细一点解决方案。。。希望高手指点。。。服务器:window server 2003,iis 6.0

------解决方案--------------------
你先使用一个固定的文件进行测试,或者调用命令行的转换进行测试,以发现问题出在哪里,
比如
Process.Start("x:\\FlashPaper2\\FlashPrinter.exe x:\\xx.pdf -o x:\\xx.swf")