zippy1978 / ghost4j

Java wrapper for Ghostscript C API + PS/PDF document handling API
http://www.ghost4j.org
GNU Lesser General Public License v3.0
64 stars 38 forks source link

Pass Post Script as an argument, not a file #53

Open andrii-kovalenko-ct opened 7 years ago

andrii-kovalenko-ct commented 7 years ago

First of all, thanks for your library.

Now the question :)

I run your lib to convert PDF to JPG with the following arguments:

-q 
-dBATCH 
-dNOPAUSE 
-sDEVICE=jpeg 
-dJPEGQ=98 
-r96 
-dTextAlphaBits=4 
-dGraphicsAlphaBits=4 
-sOutputFile=target.jpg 
-f 
watermark.ps
input.pdf

i'd like to avoid using watermark.ps as a file but put Post Script directly to the function call. Is it possible? Something like:

...
-sOutputFile=target.jpg 
-c "<<   /EndPage  { pop pop .....   } bind >> setpagedevice"
-f 
input.pdf

Thanks for concern.