Postscript ghostscript output - printing

This might sound like a very foolish question but I've been reading around and haven't been able to understand the lifecycle of a print job.
Program → PostScript → GhostScript → ? → Printer
My doubt is, what ( if any ) comes in the place of ? ?

To be honest, in general Ghostscript isn't in that loop at all, though it depends very much on your printer and operating system.
In general you would send PostScript directly to the printer, which would have a PostScript interpreter built in. If you don't have a PostScript printer, then you would (normally) produce some other page description language (eg HP PCL) and send that to the printer.
However (expanding slightly on what george said above) on Unix systems you may be using CUPS (Common Unix Printing System), which does use Ghostscript to render PostScript to a raster format (CUPS raster) for non-PostScript printers. The CUPS printer drivers repackage the raster into a form suitable for the specific printer.
Note that modern versions of CUPS use PDF as an intermediate format and so Ghostscript may be involved twice, once to create a PDF from the PostScript, and once to render a PDF to raster (or indeed, to convert it back to PostScript.....)
Also, there is the gsprint application, which works on Windows, it uses Ghostscript to render a bitmap which is written to a printer canvas and then using GDI calls printed to the printer using the Windows printer driver.

If you want to go the ghostscript route, the question mark would be filled in with "gsprint" which is part of the "gsview" package.
gsview allows postscipt files to be viewed with ghostscipt, where gsprint allows postscript files to be sent to a printer with ghostscript.
http://pages.cs.wisc.edu/~ghost/redmon/index.htm
Then to create a windows printer to be able to send the postscript output to, which would then run gsprint and output to a printer, you need "redmon".
http://pages.cs.wisc.edu/~ghost/redmon/index.htm

Your OS printer driver would fit in that spot. It receives the rendered output from ghostscript and converts it to a printer-specific format.

Related

Printing postscript with GSView 5.0

I've been using GSView 5.0 and GhostScript 9.52 to do postscript printing on vellums. However, today GSView started throwing error codes on every .ps file I've attempted to print. I'm using Windows 10 Pro and the printer is an Epson Artisan 1430.
The error is as follows:
GPL Ghostscript 9.52: **** Could not open file 00000e60.
Unrecoverable error: invalidfileaccess in showpage
Operand stack:
--nostringval-- 1 true
gsapi_execute_cont returns -9
gsapi_exit returns 0
I've tried changing permissions for the files and different printer drivers to no avail. I'm sorry I can't be more descriptive on this issue as it's hard to articulate.
OK... You must have recently updated to a new version of Ghostscript. I can reproduce your problem, and it comes down to a recent (documented) change in behaviour for Ghostscript.
Due to the well-documented public disclosure of security exploits using Ghostscript a couple of years ago, the current version (and any version since 9.50) now defaults to running in SAFER mode.
When running in SAFER, Ghostscript prevents access by the PostScript interpreter to the file system. For those unaware of the problem; PostScript is a full-blown programming language and, by design, permits programs to access the underlying file system. SAFER mode prevents this so that malicious PostScript programs cannot, for example, run arbitrary code on your computer.
It seems that GSView is using Ghostscript in a way which requires it to read the PostScript program to be printed using the PostScript interpreter, instead of the more normal practice of specifying the input file as one of the arguments. For simplicity the input file is granted read availability by the Ghostscript executable. I suspect that GSview is using the DLL directly and not adding that extra information.
Now there are ways to permit access to specific files or folders, so that existing PostScript programs can continue to work, but obviously this requires some changes in the calling application. GSview has not changed in, literally, years so obviously it does not take any such action.
You can, however, get GSview to work as before. Under Options select Advanced Configure. In the resulting dialog look for the 'Ghostscript options' text box. In there add -dNOSAFER, that should get it to work again, though you may have to reboot the computer if the OS print subsystem has stalled.
Yes, this does open you up to the sorts of exploits I alluded to above, you should only do this with PostScript programs that you trust.

Emulate EPL2 Printer Serverside

There have been a few questions on SO about emulating a ZPL printers etc, but all of them require some native application or a an app.
(see here: Emulate ZPL printer )
My Question:
Is it possible to emulate the EPL2 printer language to render a .png on a unix machine via code?
You'd have to code an app to do it. As far as I know, Zebra hasn't released the fonts built into the printer though, so it would be very tedious...

How to use right gutenprint driver in ghostscript?

For a research project about printing nanofluids with an Piezo electric printer I want to see the the code that the computer sends to the printer. I am running Ubuntu 16.04 and have an Epson Stylus SX600FW printer.
Using Ghostscript 9.18 I want to print a simple ps file and obtain the output file that is being send to the printer. This file should contain some ESC/P sequences if I am right. Now I have some problems with the rigth driver is Ghostscript.
I want to print the file using : gs -sDEVICE=epson -sOutputFile=%pipe%lpr test.ps. The printer starts the print gibberish. Just some letters and symbols on page, not the two words that are in my test.ps.
So probably ghostscript doesn't use the rigth driver. How can I get gs to use the escp2-of-sx600fw or Epson-Stylus_Office_SX600FW driver, as stated on the gutenprint site?
Kind Regards Rick
If you want to use a non-standard device, then you will have to rebuild Ghostscript and tell it to include the device's source in the build.
Nobody has supplied us with source to an Epson SX600FW device, so we don't supply it, not even in the contrib directory. There is a 'vector' Espon device in there, but its not built in as standard.
Looks like Gutenprint itself drives the printer. Presumably it only uses Ghostscript to render PostScript and PDF files into some intermediate format that it can then convert onwards to the specified device format. If I'm right, then you can't make Ghostscript use the Gutenprint device driver, as that will be specific to GutenPrint. You'll have to use Gutenprint to do that.

ghostpcl mswinpr2

I am having difficulties to print a pcl file to a gdi printer via ghostpcl. On some forums a suggested solution is to set mswinpr2 as the output device. This should produce GDI output for a windows printer. The problem is, there seems to be no mswinpr2 built into ghostpcl. When running ghostpcl -? there is no such device listed. Can anyone clarify this?
I'm not sure what version you are using, but for me the executable is called pcl6.exe, not ghostpcl. In any event the mswinpr2 device is not built into the PCL interpreter by default. While it may work with the PCL interpreter, it depends how the device was written. If you want to use it you'll have to build GhostPCL from source.

Switch Zebra S4M to EPL

When connected, my Zebra printer the S4M is recognised by Windows with the "ZDesigner S4M-203dpi ZPL" driver and I'd like to use the EPL Driver "ZDesigner S4M-203dpi EPL".
I tried to install it manually, delete the ZPL driver, use the Zebra utility setup, upgrade the firmware to the last version but I didn't find the switch option.
I found one answer : http://www.fixya.com/support/t1950296-zebra_sm4_label_printer_change_zpl_epl
You will need to change the firmware on this printer in order to be able to change the language. I don't believe this printer will allow you to change the language using the advanced options in the menu unless they have recently changed this.
I found also a web page which proposed to download old driver for the S4M but I prefer to avoid it. http://www.jamfrance.com/site/support/download.asp?categorie=13
Note : To verify if the EPL driver was working, I used a custom application which send EPL data and I tryied to use Zebra firmware downloader which have 2 interesting options : Send EPL page and Send ZPL Page. You probably guessed, only the ZPL page works.
well i found the solution : https://km.zebra.com/kb/index?page=answeropen&type=open&searchid=1324718583535&answerid=16777216&iqaction=5&url=https%3A%2F%2Fkm.zebra.com%2Fkb%2Findex%3Fpage%3Dcontent%26id%3DSO8156%26actp%3Dsearch%26viewlocale%3Den_US&highlightinfo=6292684,73,91#
The EPL firmware is listed in the Special Firmware section on Zebra.com.
I have to install the special firmware of the S4M and it works .. it's sad that they don't explain the "Special" term (and in the release note also)

Resources