0

i'm trying to convert on windows 7 stdin to pdf using ghostscript, and instead of generating a local file, i want to send this file directly to my exe file.

I'm doing this

C:\Programas\gs\gs9.05\bin\gswin64c.exe -IC:\Programas\gs\gs9.05\lib;C:\Programas\gs\fonts -sDEVICE=pdfwrite -r300 -dNOPAUSE -dSAFER -sPAPERSIZE=a4 -sOutputFile=%%pipe%%"C:\Projectos\Online File Manager\Codigo\Ruby\shoes apps\FileCreate7.exe"

(I've meanwhile put the exe inside a cmd file)

I'm getting the error :

GPL Ghostscript 9.05: **** Could not open the file %pipe%c:\tempRep\filecreate.cmd .
Unrecoverable error: ioerror in setdevice
Operand stack:
    --nostringval--

Any suggestions ?

MrWater
  • 1,797
  • 4
  • 20
  • 47

1 Answers1

1

Basically, you can't do this. The pdfwrite device opens the output stream as 'seekable' which clearly isn't compatible with a pipe or other similar construct. You need to have a local file.

KenS
  • 30,202
  • 3
  • 34
  • 51
  • Hi @KenS, I can do that, but how could i automatically invoke my exe - or cmd - file to read the pdf? Any ideas ? (this question relates to http://stackoverflow.com/questions/11405655/so-transparent-that-i-cant-catch-it-using-rghost-to-emulate-ghostscript-comma) Thanks – MrWater Jul 12 '12 at 09:19
  • I'm afraid I know absolutely nothing about Ruby, and I'm not really sure what you mean here. If you are forking a process to run Ghostscript you can have your executable read the PDF file when the process ends. – KenS Jul 12 '12 at 16:03
  • Well, i tried at first running a .cmd (or .bat) file with two lines. On the first line i would call gs writing the pdf to a file. On the second line i would call my app. The problem is that the app didn't run, only gs got executed...Why won't my second line of the batch file run ? – MrWater Jul 12 '12 at 16:11
  • Without seeing the script I can't really comment. I have used scripts (on Linux) and Windows Command Shell commands myself so I know there's nothing unique about Ghostscript which prevents this working. – KenS Jul 13 '12 at 07:09