1

I want to create in memory the pdf that I am creating and not physically and I don't know how to do it with ghostscript.

this is my code:

 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(" -dUseCIEColor");
                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);

jonathan
  • 57
  • 6

1 Answers1

1

You can't do it in memory with Ghostscript, the PDF file is always written to a file system. You can store it on Ghostscript's RAM file system, but that's unlikely to help you with what you are trying to do.

Don't use -dUseCIEColor.

You aren't running a pdfa_def.ps file, which is required to set up some aspects of a PDF/A output file. See the documentation for more details.

KenS
  • 30,202
  • 3
  • 34
  • 51