473,790 Members | 3,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Local DotMatrix Lineflow Single Line Print

Hi,
I have a Monitoring application that needs to output single line
summaries to a local dot matrix printer loaded with line flow. ie. It
will have exclusive use of the printer which is connected to LPT1.

I need to get the normal number of lines to each page. ie 60 summaries
onto a 66 line lineflow page

Am I restricted to the Printdocument object and graphics printing or
is there a way to do a single line text print?

If it is Printdocument object then how do you prevent page feed at the
end of the document?

Thanks
Bob

Nov 20 '05 #1
7 6553
Hi Bob,

Thanks for using Microsoft MSDN Managed Newsgroup. My name is Peter, and I
will be assisting you on this issue.

First of all, I would like to confirm my understanding of your issue.

From your description, I understand that you wants to print just one single
line text onto the page and prevent page feed a the end of the document.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may try to use the WritePrinter API to write data to the
printer directly, when you want to end the page you may try the
EndPagePrinter API.

[NOTE]
WritePrinter is a microsoft-provided local print provider that writes RAW
data from a specified buffer location to a SPECIFIED printer. all the print
control commands sent by this API are specific for specified printer only,
and windows can NOT print windows-based font (WYSIWYG) by calling this API.

WritePrinter
http://msdn.microsoft.com/library/de...us/gdi/prntspo
l_7zqq.asp

EndPagePrinter
http://msdn.microsoft.com/library/de...us/gdi/prntspo
l_52r6.asp

Here is a VB.NET sample you may take a look.
HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
http://support.microsoft.com/?id=322090

Please Apply My Suggestion Above And Let Me Know If It Helps Resolve Your
Problem.
You may also try some reporter tool which will implement similar function.
e.g. Crystal Report shipped with VS.NET

Best regards,

Perter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #2
Hi Peter,
Thank you for your response,
This is just what I need.
Much appreciated.
regards
Bob

Peter Huang wrote:
Hi Bob,

Thanks for using Microsoft MSDN Managed Newsgroup. My name is Peter, and I
will be assisting you on this issue.

First of all, I would like to confirm my understanding of your issue.

From your description, I understand that you wants to print just one single
line text onto the page and prevent page feed a the end of the document.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may try to use the WritePrinter API to write data to the
printer directly, when you want to end the page you may try the
EndPagePrinter API.

[NOTE]
WritePrinter is a microsoft-provided local print provider that writes RAW
data from a specified buffer location to a SPECIFIED printer. all the print
control commands sent by this API are specific for specified printer only,
and windows can NOT print windows-based font (WYSIWYG) by calling this API.

WritePrinter
http://msdn.microsoft.com/library/de...us/gdi/prntspo
l_7zqq.asp

EndPagePrinter
http://msdn.microsoft.com/library/de...us/gdi/prntspo
l_52r6.asp

Here is a VB.NET sample you may take a look.
HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
http://support.microsoft.com/?id=322090

Please Apply My Suggestion Above And Let Me Know If It Helps Resolve Your
Problem.
You may also try some reporter tool which will implement similar function.
e.g. Crystal Report shipped with VS.NET

Best regards,

Perter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


Nov 20 '05 #3
Hello Peter,
If you are still monitoring this thread,
Could you elaborate on the instruction to:
'Add the following code inside the main application namespace but
outside any class definitions.

The only way I could get the code to compile
Was to create a class and overwrite it with the RawPrinterHelpe r code.

The Test application appears to work in that it works it way through the
appropriate routines in RawprinterHelpe r but the printer (local dot
matrix) does not respond.

(Printer is OK given that a DOS dir > prn works)
thanks
Bob
bclegg wrote:
Hi Peter,
Thank you for your response,
This is just what I need.
Much appreciated.
regards
Bob

Peter Huang wrote:
Hi Bob,

Thanks for using Microsoft MSDN Managed Newsgroup. My name is Peter,
and I will be assisting you on this issue.

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to print just one
single line text onto the page and prevent page feed a the end of the
document. Have I fully understood you? If there is anything I
misunderstood, please feel free to let me know.

I think you may try to use the WritePrinter API to write data to the
printer directly, when you want to end the page you may try the
EndPagePrinter API.

[NOTE]
WritePrinter is a microsoft-provided local print provider that writes
RAW data from a specified buffer location to a SPECIFIED printer. all
the print control commands sent by this API are specific for specified
printer only, and windows can NOT print windows-based font (WYSIWYG)
by calling this API.

WritePrinter
http://msdn.microsoft.com/library/de...us/gdi/prntspo

l_7zqq.asp

EndPagePrinter
http://msdn.microsoft.com/library/de...us/gdi/prntspo

l_52r6.asp

Here is a VB.NET sample you may take a look.
HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
http://support.microsoft.com/?id=322090

Please Apply My Suggestion Above And Let Me Know If It Helps Resolve
Your Problem.
You may also try some reporter tool which will implement similar
function.
e.g. Crystal Report shipped with VS.NET

Best regards,

Perter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.


Nov 20 '05 #4
Hello Peter,
I have done some further work on this.
The code works when printing to a networked HP1200 Laser but not when
using the Panasonic KXP-1180 Dot matrix on LPT1.
Any ideas?
Regards
Bob
bclegg wrote:
Hello Peter,
If you are still monitoring this thread,
Could you elaborate on the instruction to:
'Add the following code inside the main application namespace but
outside any class definitions.

The only way I could get the code to compile
Was to create a class and overwrite it with the RawPrinterHelpe r code.

The Test application appears to work in that it works it way through the
appropriate routines in RawprinterHelpe r but the printer (local dot
matrix) does not respond.

(Printer is OK given that a DOS dir > prn works)
thanks
Bob
bclegg wrote:
Hi Peter,
Thank you for your response,
This is just what I need.
Much appreciated.
regards
Bob

Peter Huang wrote:
Hi Bob,

Thanks for using Microsoft MSDN Managed Newsgroup. My name is Peter,
and I will be assisting you on this issue.

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to print just one
single line text onto the page and prevent page feed a the end of the
document. Have I fully understood you? If there is anything I
misunderstood, please feel free to let me know.

I think you may try to use the WritePrinter API to write data to
the printer directly, when you want to end the page you may try the
EndPagePrinter API.

[NOTE]
WritePrinter is a microsoft-provided local print provider that writes
RAW data from a specified buffer location to a SPECIFIED printer. all
the print control commands sent by this API are specific for
specified printer only, and windows can NOT print windows-based font
(WYSIWYG) by calling this API.

WritePrinter
http://msdn.microsoft.com/library/de...us/gdi/prntspo

l_7zqq.asp

EndPagePrinter
http://msdn.microsoft.com/library/de...us/gdi/prntspo

l_52r6.asp

Here is a VB.NET sample you may take a look.
HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
http://support.microsoft.com/?id=322090

Please Apply My Suggestion Above And Let Me Know If It Helps Resolve
Your Problem.
You may also try some reporter tool which will implement similar
function.
e.g. Crystal Report shipped with VS.NET

Best regards,

Perter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.


Nov 20 '05 #5
Hi Bob,

Thank for your reply.

Since the code works when printing to a networked HP1200 Laser printer, to
isolate the problem,I think you may try to make a test with the file in the
KB article below, so that we will know where the problem is.

http://support.microsoft.com/default...b;EN-US;138594
HOWTO: Send Raw Data to a Printer by Using the Win32 API

You may have a try and let me know the result.
If this does not work, can you describe the what error do you get? Does the
printer print out something messy or doesn't do any thing?

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #6
Hi Peter,
Thanks
again for continuing to monitor this thread.
I tried to pull my subsequent 'help' message but too late.
All is well.
I had to append 'vbNewLine' to the test string to get
the printer to output it. It was just sitting in the buffer.
regards
Bob
Peter Huang wrote:
Hi Bob,

Thank for your reply.

Since the code works when printing to a networked HP1200 Laser printer, to
isolate the problem,I think you may try to make a test with the file in the
KB article below, so that we will know where the problem is.

http://support.microsoft.com/default...b;EN-US;138594
HOWTO: Send Raw Data to a Printer by Using the Win32 API

You may have a try and let me know the result.
If this does not work, can you describe the what error do you get? Does the
printer print out something messy or doesn't do any thing?

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


Nov 20 '05 #7
Hi Bob,

I am glad that you make your printer work.
:)

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #8

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

Similar topics

47
3651
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable sources. Usage could be something like: >>> res = where: >>> def f(x):
1
1713
by: Bill | last post by:
Hello everyone, When printing from Acc97 Runtime on W98 the paper size to the default printer should match the report, which is fine and everything prints Ok. However in XP and Win2000 the paper size for the report appears to read and the paper size in Server Properties is ignored. Only problem is that the page eject is not right, it will advance by 6mm longer than the report size. Not too bad for a single print but no good for a batch...
0
1400
by: Sukh | last post by:
Hi, I am trying to print a invoice form with data from dataset using vb.net and printer is dot matrix. Invoice is a continues paper with pre-printed headers like First Name, Last Name, SSN# etc. and after each header their are some blank block like for SSN# 9 small box. I hv to print each digit in seprate box. When I tried using following code it print 1st and 2nd digit on correct place but for the next one goes between two box ColPosX =...
1
2403
by: sukhsinghin | last post by:
Hi, I am trying to print a invoice form with data from dataset using vb.net and printer is dot matrix. Invoice is a continues paper with pre-printed headers like First Name, Last Name, SSN# etc. and after each header their are some blank block like for SSN# 9 small box. I hv to print each digit in seprate box. When I tried using following code it print 1st and 2nd digit on correct place but for the next one goes between two box ColPosX...
4
5645
by: sukhsinghin | last post by:
Hi, I am trying to print a invoice form with data from dataset using vb.net and printer is dot matrix. Invoice is a continues paper with pre-printed headers like First Name, Last Name, SSN# etc. and after each header their are some blank block like for SSN# 9 small box. I hv to print each digit in seprate box. When I tried using following code it print 1st and 2nd digit on correct place but for the next one goes between two box ColPosX...
5
2441
by: Michal Kwiatkowski | last post by:
Hi! I'm building a class that most of methods have similar intro, something like this: def method(self): var_one = self.attr_one var_two = self.attr_two.another_attr empty_list =
14
2478
by: Claudio | last post by:
I asked if there was a way to print directly to a dotmatrix printer. The answer was yes, but I need to know how to do it.
0
1240
by: shankarprasad | last post by:
i am new to dot printing dotmatrix through visual basic6 my problem is my client wants to print receipts in dot matrix i need to reset the to margin by 4 lines less than the point it stops after printing. Please can any one help on this
0
1201
by: mahesh123 | last post by:
Hi Folks, I want Help regarding the Printing of the datareports in the dotMatrix. I am using the VB6.0 and developed the reports in the datareports. But my customers have a dot matrix printers. So, how can i print the datareports data through the dot Matrix printers. If there is any piece code for printing the data reports through the dot Matrix please send to me. Thanks & Regards
0
9512
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
10419
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
10147
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
9987
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
5424
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
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2910
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.