4

Several pages in Internet and several answers here in StackExchange contains ghostscript commands whith the option -sDEVICE=psmono. But when I execute those commands, the ghostscript returns an error complaining that such device (psmono) is unknown.

Here is one example which I am trying to run, it returns 1 as error code:

$ gs -sDEVICE=psmono -dNOPAUSE -dBATCH -dSAFER -sOutputFile=out.ps in.ps

GPL Ghostscript 9.21 (2017-03-16)
Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Unknown device: psmono

I am using Arch Linux, and Ghostscript's version is 9.21, the last version from ArchLinux's repository.

There is another package that I have to install in order to have extra ghostscript devices (e.g. psmono)? Or this device was present in a previous version of ghostscript and is not disponible in newer versions (and if it is the case, how can I have the psmonobehaviour now)? Or this is a falt from ArchLinux packagers who do not compile ghostscripts with the necessary compile options?

Seninha
  • 143
  • 5

2 Answers2

2

According to Ghostscript Devices: "Many of the devices listed are not available in the standard configurations."

"If the device you need is not listed, but does appear in the list below, you will need to recompile Ghostscript. If you want a printer device that is not listed, look carefully for an alternate device that may work with your printer. If all else fails, you may have to modify an existing device to suit your printer."

In short, Arch Linux (or you) will need to build for psmono if you need it. It's not an additional package to install.

Building Ghostscript is not completely straightforward. Here are some instructions to build Ghostscript if you choose to go that route.

user3486184
  • 161
  • 5
1

PS stands for Postscript (which is what a PDF file is a capture of, more or less)

mono is used in several Ghostscript commands indicating a monochrome output.

Together I assume this means that the answers suggesting this string as sending a monochrome postscript output, and as the question is about creating a black-and-white PDF, I believe that guess is justified.

The availability of these commands may depend on Ghostscript recognizing a Postscript output device.

In the Ghostscript documentation you'll find that running the -h command will list the Ghostscript-detected devices on your system.

music2myear
  • 40,472
  • 44
  • 86
  • 127