Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

isDeviceSupported("ps2write") does not work correctly #52

Open
omasseau opened this issue Nov 7, 2016 · 0 comments
Open

isDeviceSupported("ps2write") does not work correctly #52

omasseau opened this issue Nov 7, 2016 · 0 comments

Comments

@omasseau
Copy link

omasseau commented Nov 7, 2016

There is a problem when parsing the device names to check if ps2write device is supported.

Here is the content of the result variable on line 121:

GPL Ghostscript 9.15 (2014-09-22)
Copyright (C) 2014 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
[/pnggray /tiffsep1 /bmpgray /bmp32b /pgmraw /pnmraw /t4693d8 /pj /cdj550 /plibc /eps9mid /eps2write /png16 /tiffscaled /bmp16 /psdcmyk /pgnm /ppm /tek4696 /pjxl /uniprint /plibk /epsonc /txtwrite /png256 /tiffscaled8 /bmp256 /psdrgb /pgnmraw /ppmraw /pcxmono /pjxl300 /djet500c /plan /ibmpro /pxlmono /png16m /tiffscaled24 /bmp16m /cp50 /pkmraw /pamcmyk32 /pcxgray /jetp3852 /declj250 /plang /deskjet /pxlcolor /pngalpha /tiffscaled32 /tiff12nc /nullpage /tiffcrle /pamcmyk4 /pcx16 /r4081 /lj250 /planm /djet500 /xpswrite /fpng /tiffscaled4 /tiff24nc /tiffg3 /pnmcmyk /pcx256 /lbp8 /st800 /planc /laserjet /inkcov /display /psdcmykog /bit /tiff48nc /tiffg32d /pam /pcx24b /m8510 /stcolor /plank /ljetplus /ink_cov /mswindll /jpeg /bitrgb /tiffgray /tiffg4 /spotcmyk /pcxcmyk /necp6 /bj10e /ljet3 /ljet2p /bbox /mswinpr2 /jpeggray /bitcmyk /tiff32nc /tifflzw /devicen /pbm /bjc600 /bj200 /ljet3d /cdeskjet /plib /ijs /jpegcmyk /pngmono /tiff64nc /tiffpack /bmpsep1 /pbmraw /bjc800 /t4693d2 /ljet4 /cdjcolor /plibg /epson /pdfwrite /pngmonod /tiffsep /bmpmono /bmpsep8 /pgm /pnm /t4693d4 /ljet4d /cdjmono /plibm /eps9high /ps2write]

On line 127 you do:
String[] deviceNames = lines[i].substring(1, lines[i].length() - 2).split("/")

The substring seems to be too short as we get:

[, pnggray , tiffsep1 , bmpgray , ...., eps9high , ps2writ]

The e from ps2write is missing.

As a consequence the method returns false and the choosen device is pswrite instead of ps2write.
But pswrite is not a supported device.
This leads to this error:
org.ghost4j.GhostscriptException: Cannot initialize Ghostscript interpreter. Error code is -100

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant