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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

out data to print through lpt1

Status
Not open for further replies.

bros

Programmer
Jul 14, 2000
57
MY
I use command
Open "lpt1:" for output as 1
pint #1 "aaa"
close 1

can I set the font size, & font type in VB.
And how do I to control the page, which I like to print half page only.

May I know are the dot matrix printer and laser printer have different format???

thanks
 
When you use Open "lpt1:", you're using an old MS-DOS interface which was designed for text files. Text files don't have font information in them. (When you change the font in Notepad, it only changes the font Notepad uses to display the text; the selected font isn't saved in the file.) But don't worry, you may still be able to do it.

Many printers, both dot matrix and laser, have a control language that can be embedded in the text to be printed. For example, Hewlett Packard laser printers have a control language called PCL. Using this control language, you can make the printer select a type face and size, paper bin, and lots of other things.

When you embed the control language in the text, you're bypassing Windows' printer control functions and using the functions built into the printer instead. One consequence of this is that you can only use fonts that are built into the printer, not Windows TrueType fonts.

The fonts and other built-in printer control functions vary from one printer model to another. So does the control language you embed in the text. You'll need to find your printer's manuals and look up how to program them. (You may even have to order programming manuals from the printer manufacturer.)

If you're going to run this on multiple printers with different control languages, you'll have to figure out which kind of printer is attached as LPT1 and change the control language to suit it. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top