1. Win32 printing unformatted text

I want to use Win32Lib to print raw text strings (a la PCL code, but for
a different printer language).  How would I set up my printer DC and
wPuts (or is there a different command?) to make sure only the text
string is being sent to the printer and not a bitmap image?

Mike Sabal

new topic     » topic index » view message » categorize

2. Re: Win32 printing unformatted text

Mike:

The PCL codes would be handled by the PRINT DRIVER
so you would need a driver for the particular printer
code you are using.

Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.ew

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

3. Re: Win32 printing unformatted text

On Fri, 17 Dec 2004 10:18:20 -0500, Mike Sabal
<Sabal.Mike at notations.com> wrote:

>
>
>I want to use Win32Lib to print raw text strings (a la PCL code, but for
>a different printer language).  How would I set up my printer DC and
>wPuts (or is there a different command?) to make sure only the text
>string is being sent to the printer and not a bitmap image?
>
Maybe open("COM1","wb") or open("PRN","wb")  and normal puts?

Pete

new topic     » goto parent     » topic index » view message » categorize

4. Re: Win32 printing unformatted text

>>> guest at RapidEuphoria.com 12/17/2004 10:28:41 AM >>>
Mike:

The PCL codes would be handled by the PRINT DRIVER
so you would need a driver for the particular printer
code you are using.

Bernie

Maybe open("COM1","wb") or open("PRN","wb")  and normal puts?

Pete

--------------------------

There are 3 reasons why this won't work: 
1. The bitmap is about 300kb per page, where the raw text is about 1kb
per page.  We need the speed (1000's of pages being generated).
2. The printer needs to print the page upside down.  This is easy with
raw text, but not so easy in a bitmap.
3. I like the idea of opening the printer with open ("PRN","wb"), and
will do that if 1 problem can be overcome: the printer is being shared
through Terminal Services, so it's neither a local or remote (IP)
printer.  The only way to access it is through the Windows printer
selection.  If there is a routine that will let me do something like

prnFileName = getPrinterPortName("Soabar printer on 00214120122")
open(prnFileName,"wb")

and send the raw text, this will work.

Mike Sabal

new topic     » goto parent     » topic index » view message » categorize

5. Re: Win32 printing unformatted text

You can find the WritePrinter function in winspool.dll
You can use this to send raw data to a printer.

The definition:
BOOL WritePrinter(
  HANDLE hPrinter,   // handle to printer object
  LPVOID pBuf,       // array of printer data
  DWORD cbBuf,       // size of array
  LPDWORD pcWritten  // bytes written to printer
);

--
The Internet combines the excitement of typing 
with the reliability of anonymous hearsay.
tommy online: http://users.telenet.be/tommycarlier
tommy.blog: http://tommycarlier.blogspot.com

new topic     » goto parent     » topic index » view message » categorize

6. Re: Win32 printing unformatted text

>>> guest at RapidEuphoria.com 12/17/2004 11:48:25 AM >>>
You can find the WritePrinter function in winspool.dll
You can use this to send raw data to a printer.

The definition:
BOOL WritePrinter(
  HANDLE hPrinter,   // handle to printer object
  LPVOID pBuf,       // array of printer data
  DWORD cbBuf,       // size of array
  LPDWORD pcWritten  // bytes written to printer
);

---------------
This looks like what I need.  Thanks.

Mike

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu