我想使用 GhostscriptProcessor 将 PDF 文件转换为 PDF/A,但结果是 PDF 而不是 PDF/A。
GhostscriptProcessor gsproc = new GhostscriptProcessor(Properties.Resources.gsdll32);
gsproc.StartProcessing(CreatePDFA(@"C:\test\PDF.pdf", @"C:\test\PDFA.pdf"), new GsStdio());
和方法:
CreateTestArgs(string inputPath, string outputPath)
{
List<string> gsArgs = new List<string>();
gsArgs.Add("-dPDFA");
gsArgs.Add("-dBATCH");
gsArgs.Add("-dNOPAUSEgsArgs");
gsArgs.Add("-sDEVICE=pdfwrite");
gsArgs.Add(@"-sOutputFile=" + outputPath);
gsArgs.Add(@"-f" + inputPath);
return gsArgs.ToArray();
}
如果我从命令行使用 gswin32.exe,则结果是 PDF/A 文件。