Article View: comp.os.os2.programmer
Article #3441Re: Printing ASCII
From: David Charlap
Date: Mon, 11 Jan 1993 21:21
Date: Mon, 11 Jan 1993 21:21
37 lines
2592 bytes
2592 bytes
In article <C0I756.CA8@undergrad.math.waterloo.edu> gmcarthu@napier.uwaterloo.ca (Grant McArthur) writes: >In article <1ihok0INNmb8@morrow.stanford.edu> GG.MPD@forsythe.stanford.edu (Michael Durket) writes: >>Is there an interface into OS/2 printing that allows you to >>submit an ASCII file to be printed on any printer (i.e. does >>OS/2 have a general purpose ASCII to printer-dependent page >>formatting routine)? I'd like to avoid writing a routine to >>do this for my program if one already exists that I can use. > >Use LPT1: (or whatever printer port you wish) like a file. Use DosOpen with >LPT1: as the file name, and then treat it like a file with DosWrite() calls. This won't work. If you just send to LPT1 and don't engage the spooler, you'll just send directly to the printer. If your printer can print ASCII by simply sending it ASCII (as most non-PostScript printers can), there's no problem. But sending PS stuff without a header will result in not even a blank page. To do this properly within an app, you should access the spooler to get your text formatted into a printer-specific file and send that. I don't know how to do this, however. If you're using/writing a DOS app, you've got to format it yourself, but you already knew that. >I found that worked nicely for printed ASCII to a printer. (My case was >information tables to a HP emulating printer by the NULL printer driver.) Using the WPS to drag the file over the printer icon will work. It will ask you if the file is printer-specific or text. If you select "printer specific", then the file will be dumped as-is. If you select ASCII text, it will be formatted for your printer and printed (I believe) in the courier font. This will successfully get ASCII to a PS printer without extra software. -- |) David Charlap | .signature confiscated by FBI due to /|_ dic5340@hertz.njit.edu | an ongoing investigation into the ((|,) | source of these .signature virusses ~|~
Technical Details
Message-ID:
<1993Jan11.212104.29764@njitgw.njit.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!gatech!concert!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340References:
<1ihok0INNmb8@morrow.stanford.edu> <C0I756.CA8@undergrad.math.waterloo.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!gatech!concert!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340 From: dic5340@hertz.njit.edu (David Charlap) Newsgroups: comp.os.os2.programmer Subject: Re: Printing ASCII Message-ID: <1993Jan11.212104.29764@njitgw.njit.edu> Date: 11 Jan 93 21:21:04 GMT References: <1ihok0INNmb8@morrow.stanford.edu> <C0I756.CA8@undergrad.math.waterloo.edu> Sender: news@njit.edu Distribution: na Organization: New Jersey Institute of Technology, Newark, N.J. Lines: 37 Nntp-Posting-Host: hertz.njit.edu