[bug-gswin] Setting DEVICE=pdfwrite says " Unable to open the initialdevice"

Ray Johnston ray.johnston@artifex.com
Thu, 16 Jan 2003 11:49:24 -0800


David,

The command line options are case sensitive, so -SDEVICE= is not correct.

You need to use -sDEVICE=pdfwrite

The message results from attempting to open the default device (whatever
it is for your build -- gswin32c -h will tell you).

Note that to send the PDF file to stdout (using -sOutputFile=-) you
should also make sure and suppress other messages. Also, you should use
the .setpdfwrite command to set internal options correctly for using the
pdfwrite device (the ps2pdf.bat script does this automatically). The
correct command line is:

/c/gs/gs8.00/bin/gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=- -c .setpdfwrite -f test.ps

Regards,
Ray Johnston
________________________________________________________________________
David Karr wrote:
> 
> -----------------------------------------------------------------------
> -
> Symptoms:
> I run:
> /c/gs/gs8.00/bin/gswin32c -SDEVICE=pdfwrite -sOutputFile=- test.ps
> 
> and it prints:
> 
> AFPL Ghostscript 8.00 (2002-11-21)
> Copyright (C) 2002 artofcode LLC, Benicia, CA.  All rights reserved.
> This software comes with NO WARRANTY: see the file PUBLIC for details.
> **** Unable to open the initial device, quitting.
> 
> -----------------------------------------------------------------------
> -
> Ghostscript version (or include output from "gs -h"):
> AFPL Ghostscript 8.00 (2002-11-21)
> Copyright (C) 2002 artofcode LLC, Benicia, CA.  All rights reserved.
> 
> -----------------------------------------------------------------------
> -
> Where you got Ghostscript:
> http://sourceforge.net/projects/ghostscript/
> 
> -----------------------------------------------------------------------
> -
> Hardware system you are using (including printer model if the problem
> involves printing):
> 
> IBM NetVista PC
> 
> -----------------------------------------------------------------------
> -
> Operating system you are using:
> Windows XP, with Cygwin 1.3.18-1.
> 
> -----------------------------------------------------------------------
> -
> If you are using X Windows, and your problem involved output to the
> screen, the output from running xdpyinfo and xwininfo:
> 
> -----------------------------------------------------------------------
> -
> C compiler you are using, including its version, if you compiled
> Ghostscript yourself:
> 
> -----------------------------------------------------------------------
> -
> If you compiled Ghostscript yourself, changes you made to the
> makefiles:
> 
> -----------------------------------------------------------------------
> -
> Environment variables:
> 
>         GS_DEVICE
> 
>         GS_FONTPATH
> 
>         GS_LIB
> 
>         GS_OPTIONS
> 
> These are all unset.
> 
> -----------------------------------------------------------------------
> -
> Command line:
> /c/gs/gs8.00/bin/gswin32c -SDEVICE=pdfwrite -sOutputFile=- test.ps
> 
> -----------------------------------------------------------------------
> -
> URL or FTP location of test files (include the data at the end of this
> form if 500K or less):
> 
> "test.ps" is 10221 bytes, so I'll include it at the end.
> 
> -----------------------------------------------------------------------
> -
> Suggested fix, if any:
> 
> -----------------------------------------------------------------------
> -
> Other comments:
> 
>   ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>               Name: test.ps
>    test.ps    Type: Gvim File (application/postscript)
>           Encoding: base64