Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Print from DOS app

Print from DOS app

Print from DOS app

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
    DocumentName="Local Downlevel Document"
  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?

RE: Print from DOS app

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?

RE: Print from DOS app

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..

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close