GhostScript没有在64位操作系统中运行

时间:2014-06-21 06:46:01

标签: c# cmd ghostscript

以下C#代码我可以在Windows 7 32位操作系统中运行,但它不能在Windows 7 64位操作系统中运行。即使我使用了替代工作目录,但我不知道它为什么不生成TIFF文件。

注意:如果我使用直接命令提示它的工作正常。但是在C sharp它没有用。

       System.Diagnostics.Process process = new System.Diagnostics.Process();
        System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
        startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
        startInfo.WorkingDirectory = @"C:\Program Files (x86)\gs\gs9.14\bin";

        //startInfo.WorkingDirectory = @"C:\Program Files\gs\gs9.14\bin"; 

        startInfo.FileName = "cmd.exe";
        startInfo.Verb = "runas";

        startInfo.Arguments = "/c gswin32c -dBATCH -sDEVICE=tiff24nc -sCompression=lzw -r300x300  -dNOPAUSE -sOutputFile=D:\\Test\\Project%04d.tiff E:\\21062014\\MedSoft\\MedSoft\\bin\\Debug\\Output\\02_Combined.pdf";

        process.StartInfo = startInfo;
        process.Start();

1 个答案:

答案 0 :(得分:0)

我建议您使用Ghostscript包装器 .NET

您可以在此处找到:Ghostscript.NET on GitHub

用法示例可在此处找到:Ghostscript Processor C# Sample

相关问题