473,473 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create 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 6514
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 RawPrinterHelper code.

The Test application appears to work in that it works it way through the
appropriate routines in RawprinterHelper 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 RawPrinterHelper code.

The Test application appears to work in that it works it way through the
appropriate routines in RawprinterHelper 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
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...
1
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...
0
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....
1
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....
4
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....
5
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
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
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...
0
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...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.