Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print from DOS app

Status
Not open for further replies.

epod69

Programmer
Feb 11, 2005
44
0
0
US
I am trying to print from a DOS application. I can redirect the LPT port to the share name of the printer just fine. Problem is, the application has built-in drivers that you can select from (HP LaserJet 4L and II for example). So according the software support, I have to use a printer that supports DOS printing. So, instead of searching for an old used printer (or buy a new expensive one that is supported), I decided I would try the GhostScript method. I assumed the application prints out data in postscript. But now I am thinking maybe this is not the case. I already installed GhostScript, GhostView, and Redmon. I setup and configured a new printer using the Redirection Port. The port points to gsprint.exe. Config file is already configured. I can print a test page from this printer and it redirects to the printer I want without any issue. The problem is this does not work from the DOS application.

This is what I get when I look at the log file from Redmon:
REDMON WriteThread: started
Level=1
DocumentName="Local Downlevel Document"
OutputFile="(null)"
Datatype="RAW"
output=0 show=2 delay=300 runuser=0

REDMON WritePort: about to write 1347 bytes to port.

*Data that is printing from the DOS application shows here in plain text*

REDMON WritePort: OK count=1347 written=1347
REDMON EndDocPort: starting

REDMON WriteThread: ending
GPL Ghostscript 8.64 (2009-02-03)
Copyright (C) 2009 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefinedfilename in (/.HWMargins)
Operand stack:

Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1152/1684(ro)(G)-- --dict:0/20(G)-- --dict:69/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 8.64: Unrecoverable error, exit code 1
Copyright (C) 2003-2006, Ghostgum Software Pty Ltd. All Rights Reserved.
2006-02-24 gsprint 1.9
REDMON EndDocPort: process finished after 3 seconds

REDMON EndDocPort: 0 bytes written to printer
REDMON EndDocPort: ending

Does anyone have any suggestions on what could be causing this? It shows what is printing in plain text in the log file, so is it because it is not postscript data? Or is there another solution out there?
 
No idea what could be causing your GhostScript problem.

But you seem to be using a sledge-hammer to crack a nut, with regard to printing from DOS.

Most modern LaserJet (and clone) printers will accept either LineFeed-delineated plain text, or a print stream generated for an older generation of LJ (e.g. HP LJ II) with few (if any) problems (there could be some oddities with font selection and perhaps raster graphics images?).

The exceptions are the relatively cheap 'host-based' devices (e.g. LJ 1010, LJ 2600, CLJ 3600, etc.) which don't support PCL (or even plain text) - but then they don't support PostScript either.

What is your target device, and what 'models' does your application offer?
 
Thanks for the response DansDadUK. I do know of a couple models that will work from HP. Problem is customer will only print a few pages at the most in a day. They are trying to use their existing ink jet printer. And because of current budget reasons, they can't buy a new non-host-based printer. I did find a used LaserJet 4200 that will work though and is fairly cheap. I am still curious on the ghostscript error though..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top