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

New Post: How to append postscript code to command line (-c)?

$
0
0
Hi!

I've spent a few hours trying to get StartProcessing accept a "-c" command line switch but somehow, it always ends up in an -100 exception.

In general, I'm trying the following:
With cmdline
                .Add("-empty")
                .Add("-dNOPAUSE")
                .Add("-dBATCH")
                .Add("-dQUIET")
                .Add("-dSAFER")
                .Add("-dNOPROMPT")
                .Add("-q")
                .Add("-o test.tif")
                .Add("-sDEVICE=tiff24nc")
                .Add("-r600")
                .Add(" -c ""<</Install {-14 -14 translate}>> setpagedevice""")
                .Add("-fTEST.pdf")
End With
GSProc.StartProcessing(cmdline.ToArray(), Nothing)
But this always leads to an -100 exception unless I remove the -c part of the command line. Somehow I guess that it has something to do with the escaping of the quotation marks around the postscript code but I didn't find any other way to build the string.

Stepping through the code, I see that the string gets converted to
" -c \"<</Install {-14 -14 translate}>> setpagedevice\""
which seems to look absolutely okay when talking about C# ... but somehow, Ghostscript refuses to accept it that way.

Is there anything I can do?

Any help would be greatly appreciated ;-)

Viewing all articles
Browse latest Browse all 393

Trending Articles



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