Solved

Printing Single Line without formfeed on Dot matrix Printer

Posted on 1998-05-15
3
241 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

759 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

16 Experts available now in Live!

Get 1:1 Help Now