473,746 Members | 2,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET 7, printing to a printer directly

Hi folks,

I wish to print on pre-printed continuous forms on a dot
matrix printer.

My initial intent was to access to printer directly (in raw
mode, somehow) in order to send whatever is necessary to do
the job.

I had to try... but FileOpen does not permit opening LPT1.

From what I gatter (I may understand this incorrectly) the
printdocument component seems to be a graphical approach at
printing on modern cut-sheet printers (laser, inkjet).

The only aspects of printing I need are to send appropriate
text, CR/LFs, formfeeds and CPI settings all the while using
the printer's default power-on font.
Alternatively, I have a back door, but it's not elegant.

1) Create a textfile.txt via VB with the appropriate
print data.

2) Shell("printit. bat", AppWinStyle.Hid e)

3) printit.bat contains: copy /b textfile.txt lpt1:
Any help to get me on the right track here would be more than
welcomed.

Thanks
Jul 21 '05 #1
2 3719
Marc,
Take a look at this article
http://www.c-sharpcorner.com/Code/20...rintDirect.asp for information
on printing directly to the printer. You should be able to adapt this to
VB.NET.

Ron Allen
"Marc Champagne" <ne**@ctldirect .DOT.com.invali d> wrote in message
news:Xn******** *************** ***********@207 .35.177.135...
Hi folks,

I wish to print on pre-printed continuous forms on a dot
matrix printer.

My initial intent was to access to printer directly (in raw
mode, somehow) in order to send whatever is necessary to do
the job.

I had to try... but FileOpen does not permit opening LPT1.

From what I gatter (I may understand this incorrectly) the
printdocument component seems to be a graphical approach at
printing on modern cut-sheet printers (laser, inkjet).

The only aspects of printing I need are to send appropriate
text, CR/LFs, formfeeds and CPI settings all the while using
the printer's default power-on font.
Alternatively, I have a back door, but it's not elegant.

1) Create a textfile.txt via VB with the appropriate
print data.

2) Shell("printit. bat", AppWinStyle.Hid e)

3) printit.bat contains: copy /b textfile.txt lpt1:
Any help to get me on the right track here would be more than
welcomed.

Thanks

Jul 21 '05 #2
"Ron Allen" <rallen@_nospam _src-us.com> wrote in
news:#q******** ******@TK2MSFTN GP09.phx.gbl:
Hi folks,

I wish to print on pre-printed continuous forms on a dot
matrix printer.

My initial intent was to access to printer directly (in
raw mode, somehow) in order to send whatever is necessary
to do the job.

I had to try... but FileOpen does not permit opening LPT1.

From what I gatter (I may understand this incorrectly) the
printdocument component seems to be a graphical approach
at printing on modern cut-sheet printers (laser, inkjet).

The only aspects of printing I need are to send
appropriate text, CR/LFs, formfeeds and CPI settings all
the while using the printer's default power-on font.
Alternatively, I have a back door, but it's not elegant.

1) Create a textfile.txt via VB with the appropriate
print data.

2) Shell("printit. bat", AppWinStyle.Hid e)

3) printit.bat contains: copy /b textfile.txt lpt1:
Any help to get me on the right track here would be more
than welcomed.

Thanks


Marc,
Take a look at this article
http://www.c-sharpcorner.com/Code/20...rintDirect.asp
for information on printing directly to the printer. You
should be able to adapt this to VB.NET.

Ron Allen
"Marc Champagne" <ne**@ctldirect .DOT.com.invali d> wrote in
message
news:Xn******** *************** ***********@207 .35.177.135...


Thanks, will give it a try, seems complex though.

--
Marc Champagne
marcch.AT.video SPAMNOTtron.DOT .ca.invalid
Montreal, Canada
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3039
by: Ryan Gregg | last post by:
I've got a dot matrix printer that I need to print a line at a time to. This is being used for an audit log on an application and every event that occurs needs to print out right as it occurs. I've previously had this working well in a serial communication method where I talk directly to the printer using control codes and what not. However, it seems that the higher ups want to be able to use a network printer or other Windows-configured...
4
13245
by: IntraRELY | last post by:
Hello All, I am developing a Web Application in VB.NET. We are printing checks from a IE 6.0. Here are our requirments: 1. Checks will be printed on pre-printed stock, so we must format the document to lineup correcly. 2. We need to keep track of which checks printed or didnt print. So we need to access the printer directly. 3. Have the ability to select any local(on the client) printer.
2
1682
by: kmtai | last post by:
vb --- Open "lpt1" For Output As #FileNu Print #FileNum, "abcd and some chinese characters --- Only a-z and 0-9 will be printed
2
489
by: Marc Champagne | last post by:
Hi folks, I wish to print on pre-printed continuous forms on a dot matrix printer. My initial intent was to access to printer directly (in raw mode, somehow) in order to send whatever is necessary to do the job. I had to try... but FileOpen does not permit opening LPT1.
0
999
by: Mike9900 | last post by:
We are developing a point of sale software and need to work with receipt printers. We need to send texts to the printer directly in desired fonts. We are able to send texts to the printer using API, howerver we cannot set its font. -- Mike
5
6476
by: Raman | last post by:
Hello friends, I want to print an ID card. I have one Windows Form that contains front and back side. The printer is printing both front and back side at a time. I am trying to send both sides at a time. But it is printing front side on one card and back side on second card. I want to print both sides in a same card.
3
3492
by: mike19182004 | last post by:
How do we print programs directly from Turbo C++ 3.0 compiler? I have tried the print function from file menu of compiler ,but it does not print!!!
0
915
by: Matt | last post by:
I am using Process.Start() and pdfp.exe to launch Adobe Reader to print PDFs directly from the server. My website's Application Pool runs under a domain account and I am having trouble getting the permissions right. It works when I add the domain account to the web server's administrators group, but this isn't something I want to do in production. Any ideas on how to give the domain account the correct permissions without adding it to...
0
4233
by: silverrock7 | last post by:
Hello Friends i m stuck up to a place wherein i want to print a report which is displaying on a reportviewer. I actually want to send the report to printer directly without viewing it. i am using a code for the same which i m posting here. I am getting an error on the line wherein i m rendering the report. the error is " a window handle is not created for the control" My code is :
0
8974
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8800
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9500
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9218
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4575
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.