Merge multiple PDFs to PostScript with GhostScript / C# - I got an answer

Mike Breeden <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.devel
Message-ID <[email protected]>
Instead of:
    params.Add("-sOutputFile=outfile.ps");
    params.Add("InFile1.PDF InFile2.PDF");

It would be:
    params.Add("-sOutputFile=outfile.ps");
    params.Add("InFile1.PDF");
    params.Add("InFile2.PDF");

I tested it and was able to concatenate 6 files. Wahoo. Nice efficiency boost for a number of reasons.

Note that another comment was put there by a gent named Ken and since the guy seemed to know what he was talking about, I'll include it here for others like me that have much to learn.

Note that -o implies -dBATCH and -dNOPAUSE so you can get the same effect in a shorter command line by setting "-o outfile.ps". 

In both cases you don't need -dNOPROMPT. Unless you are piping into GS I would not suggest using -dNOPROMPT. 

If you set -q you don't need -dQUIET (and when debugging a problem I would not set either!). 

PARANOIDSAFER is just the same as SAFER and we'd rather you used SAFER, PARANOIDSAFER is no longer documented and may be removed (although after 12 years...). 

-dLanguageLevel=3 has no effect on ps2write, because ps2write writes language level 2, hence the name... – 



*** *** *** *** *** *** *** ***




Greetings,
Can anyone suggest how to merge multiple PDF files into a single PostScript file when using GhostScript with C#
 
At the command line, it is:
gswin32c.exe -dNOPAUSE -dBATCH -sDEVICE=ps2write -sOutputFile=outfile.ps Infile1.pdf Infile2.pdf
  
    params.Add("-q");
    params.Add("-dQUIET");
    params.Add("-dNOPAUSE");
    params.Add("-dBATCH");
    params.Add("-P-");
    params.Add("-dPARANOIDSAFER");
    params.Add("-dNOPROMPT");
    params.Add("-sDEVICE=ps2write");
    params.Add("-dLanguageLevel=3);
    params.Add("-dASCII85DecodePages=false");
    params.Add("-sOutputFile=outfile.ps");
    params.Add("InFile1.PDF inFile2.PDF");
 
 
It is easy to convert multiple PDF files to a single PostScript file from the command line, but I need to do it in a program. I cannot get it to work.
I figure it would be something like:
    params.Add("InFile1.PDF inFile2.PDF"); 
as the last parameter, but no such luck

Any suggestions would be greatly appreciated. Thanks, Mike

_______________________________________________
gs-devel mailing list
[email protected]
http://ghostscript.com/cgi-bin/mailman/listinfo/gs-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.