pdf to pdf-a

Apr 29, 2015 at 8:09 AM
Edited Apr 29, 2015 at 8:15 AM
Hi,

I have a problem with the transfer pdf to pdf-a
my code:
        string inputFile = @"d:\index.pdf ";
        string outputFile = @"d:\output.pdf ";

        using (GhostscriptProcessor ghostscript = new GhostscriptProcessor())
        {
            ghostscript.Processing += new GhostscriptProcessorProcessingEventHandler(ghostscript_Processing);

            List<string> switches = new List<string>();
            switches.Add("-dPDFA ");
            switches.Add("-dBATCH ");
            switches.Add("-dNOPAUSE ");
            switches.Add("-dNOOUTERSAVE ");
            switches.Add("-dUseCIEColor ");
            switches.Add("-sProcessColorModel=DeviceCMYK");   
            switches.Add("-sDEVICE=pdfwrite");
            switches.Add("-sOutputFile=" + outputFile);
            switches.Add("d:\\PDFA_def.ps");
            switches.Add(inputFile);

            ghostscript.Process(switches.ToArray(), new GsStdio());
        }
Exception:
An exception of type 'Ghostscript.NET.GhostscriptAPICallException' occurred in Ghostscript.NET.dll but was not handled in user code

Additional information: An error occured when call to 'gsapi_init_with_args' is made: -100

Diagnostic debug output:
GS err: GPL Ghostscript
GS err: 9.16
GS err: :
GS err: Unrecoverable error, exit code 1

NuGet Packages:
Ghostscript.NET Version: 1.2.0

GS 9.16

note
When I delete the line:
switches.Add ("d: \ PDFA_def.ps");
program is okay, but output.pdf is not pdf-a valid




thank you for your help
Feb 16 at 9:00 AM
Hi all, I'm facing the same issue, has someone resolved it?

any sugestions will be welcome

thank you