Solved

Printing Single Line without formfeed on Dot matrix Printer

Posted on 1998-05-15
3
247 Views
Last Modified: 2013-12-04
How would you print a single line at a time to a dot matrix printer without the driver causing a formfeed. The line actually has to print on the paper. Just buffering lines until you have a page full is not what is needed. Microsoft had raw.drv for 16 bit apps that worked. Haven't seen anything for 32 programming. Thanks.
0
Comment
Question by:glaporte
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
dnavarro earned 100 total points
ID: 1401976
Simply open the printer as a file and print to it.  From Visual Basic:

OPEN "LPT1" FOR OUTPUT AS #1
PRINT  "This is my text";   <--  The semicolon is the key
CLOSE

We use EPSON dot matrix printers here at work for printing labels and this is how we print to the printers without going through the printer drivers.

--Dave

0
 
LVL 1

Expert Comment

by:dnavarro
ID: 1401977
Oops, I meant:

PRINT#1, "This is my text";

--Dave
0
 

Author Comment

by:glaporte
ID: 1401978
Use CreateFile() for opening the port.
WriteFile() to write to the port.
CloseHandle() for closing the port.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now