如何使用 ghostscript 同时创建 2 个 pdf 文件?

how to create 2 pdf files at the same time with ghostscript?

如何使用 GhostScript 同时创建 2 个 pdf 文件?

这是我的代码:

string gsPath = @"C:\Program Files (x86)\gs\gs9.26\bin\gswin32.exe";

                List gsArgsList = new List();
                gsArgsList.Add(" -dPDFA=2");
                gsArgsList.Add(" -dBATCH");
                gsArgsList.Add(" -dNOPAUSE");                
                gsArgsList.Add(" -sProcessColorModel=DeviceCMYK");
                gsArgsList.Add(" -sDEVICE=pdfwrite");
                gsArgsList.Add(" -dPDFACompatibilityPolicy=1");
                gsArgsList.Add(" -sOutputFile=" + nuevo);
                gsArgsList.Add(" " + rutaPdfNormal); 

                var gsArgs = String.Join(null, gsArgsList);

                string gs = gsPath + gsArgs;
                System.Diagnostics.Process.Start(gsPath, gsArgs);

您不能在一个 Ghostscript 实例中同时创建两个 PDF 文件。 pdfwrite 设备(写入 PDF 文件)仅写入单个文件。

我也看不出同时写两个文件有什么意义;也许如果你解释了你想要实现的目标,可能会提供进一步的建议。

您上面链接的示例不是同时编写两个 PDF 文件。它首先写入输出文件 'tiger.pdf' 运行 输入文件 'tiger.eps'。然后它切换到输出文件 'colorcir.pdf' 并运行文件 'colorcir.ps'。那不是同时的,而是顺序的;它与 运行 Ghostscript 两次完全相同,但命令行不同。