derderder February 2016

Ghostscript Unable to open the initial device

I have cross-compiled ghostscript 9.18 for Android. When I run it, ( I have tested gs and gs -sDEVICE=pdfwrite test.ps -sOutputFile=test.pdf, with test.ps a valid postscript file), I always have this error:

**** Unable to open the initial device, quitting. Unrecoverable error: unknownerror in .special_op

I have configure it with ./configure --prefix=/data/local/tmp --build=x86_64-linux-gnu --host=i686-linux-android --with-system-libtiff

gs --help return:

Artifex Ghostscript 9.18 (2015-10-05)
Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
 -dNOPAUSE           no pause after page   | -q       quiet, fewer messages
 -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch resolution
 -sDEVICE=<devname>  select device         | -dBATCH  exit after last file
 -sOutputFile=<file> select output file: - for stdout, |command for pipe,
                                     embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF
Default output device: bbox
Available devices:
   ap3250 appledmp atx23 atx24 atx38 bbox bit bitcmyk bitrgb bitrgbtags
   bj10e bj200 bjc600 bjc800 bmp16 bmp16m bmp256 bmp32b bmpgray bmpmono
   bmpsep1 bmpsep8 ccr cdeskjet cdj500 cdj550 cdjcolor cdjmono cfax cif
   cljet5 cljet5c cljet5pr coslw2p coslwxl cp50 declj250 deskjet devicen
   dfaxhigh dfaxlow dj505j djet500 djet500c dnj650c eps2write eps9high
   eps9mid epson epsonc escp faxg3 faxg32d faxg4 fpng fs600 gprf hl7x0
   ibmpro ijs imagen inferno ink_cov inkcov itk24i itk38 iwhi iwlo iwlq
   jbig2 jetp3852 jpeg jpegcmyk jpeggray laserjet lbp8 lips3 lj250 lj3100sw
   lj4dith lj4dithp lj5gray lj5mono ljet2p ljet3 ljet3d ljet4 ljet4d
   ljet4pjl ljetplus lp2563 lp8000 lq850 lxm5700m m8510 mgr4 mgr8        

Answers


KenS February 2016

Well the problem is what it says, it cannot open the default device. You haven't given us the command line you are using, so I'm having to guess why that would be.

Most likely the default device is not valid on your platform. I'm going to assume you built on a Linux distribution (because of the build lines) and I suspect the default device is the X device, which clearly isn't going to work on Android.

At the very least you'll need to build without X I would think, and I don't know the GS build system well enough to advise you on that. You could try the IRC #ghostscript channel on irc.freenode.net and ask chrisl there.

Other than that, do gs --help and quote exactly what it says. Amongst other things it should tell you what the default device is.

Post Status

Asked in February 2016
Viewed 3,042 times
Voted 14
Answered 1 times

Search




Leave an answer