Quantcast
Channel: Ghostscript.NET
Viewing all articles
Browse latest Browse all 393

New Post: pdf to pdf-a

$
0
0
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

Viewing all articles
Browse latest Browse all 393

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>