473,480 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Text in .NET

AHA
Is it possible in VB.NET to print document using dot matrix printer
as we do with clipper? With Clipper we can set the column and line
printing and also we can eject the printer through the code.

I have a problem to print text in pre-printed form(document) using
VB.NET. My application is a web application, is it possible to print
such a pre-printed document in Web Application. How can I do it?

Thx

Mar 15 '07 #1
9 1895
"AHA" <al**********@gmail.comschrieb:
Is it possible in VB.NET to print document using dot matrix printer
as we do with clipper? With Clipper we can set the column and line
printing and also we can eject the printer through the code.
HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>
I have a problem to print text in pre-printed form(document) using
VB.NET. My application is a web application, is it possible to print
such a pre-printed document in Web Application. How can I do it?
Web applications typically do not have access to the client's resources.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Mar 15 '07 #2
AHA
On Mar 15, 8:09 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrote:
"AHA" <allen.hut...@gmail.comschrieb:
Is it possible in VB.NET to print document using dot matrix printer
as we do with clipper? With Clipper we can set the column and line
printing and also we can eject the printer through the code.

HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>
I have a problem to print text in pre-printed form(document) using
VB.NET. My application is a web application, is it possible to print
such a pre-printed document in Web Application. How can I do it?

Web applications typically do not have access to the client's resources.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Wagner, thx for your information. But, if we try to use windows
application, is it possible to print to a pre-printed form as we do
with clipper? How?

Mar 16 '07 #3
"AHA" <al**********@gmail.comschrieb:
Is it possible in VB.NET to print document using dot matrix printer
as we do with clipper? With Clipper we can set the column and line
printing and also we can eject the printer through the code.

HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>
[...]
Wagner, thx for your information. But, if we try to use windows
application, is it possible to print to a pre-printed form as we do
with clipper? How?
Did you take a look at the document I referenced above?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Mar 16 '07 #4
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:u7**************@TK2MSFTNGP06.phx.gbl...
"AHA" <al**********@gmail.comschrieb:
>Is it possible in VB.NET to print document using dot matrix printer
as we do with clipper? With Clipper we can set the column and line
printing and also we can eject the printer through the code.

HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>
[...]
Wagner, thx for your information. But, if we try to use windows
application, is it possible to print to a pre-printed form as we do
with clipper? How?

Did you take a look at the document I referenced above?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Mar 16 '07 #5
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
Yes, it should work just fine.

AFAIK the .Net 2.0 framework only added more features, it didn't take
any away. (though some were deprecated - but the replacement is
usually mentioned in the warning.)

Thanks,

Seth Rowe
On Mar 16, 10:50 am, "Iouri" <i...@hotsheet.comwrote:
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
"Herfried K. Wagner [MVP]" <hirf-spam-me-h...@gmx.atwrote in messagenews:u7**************@TK2MSFTNGP06.phx.gbl. ..
"AHA" <allen.hut...@gmail.comschrieb:
Is it possible in VB.NET to print document using dot matrix printer
as we do with clipper? With Clipper we can set the column and line
printing and also we can eject the printer through the code.
>HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>
[...]
Wagner, thx for your information. But, if we try to use windows
application, is it possible to print to a pre-printed form as we do
with clipper? How?
Did you take a look at the document I referenced above?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Mar 16 '07 #6
No it does not work. ON this link it is written that it applies to VS2002
and VS2003
In VS2005 I am getting the message

PInvokeStackImbalance was detected
Message: A call to PInvoke function
'WindowsApplication2!WindowsApplication2.RawPrinte rHelper::OpenPrinter' has
unbalanced the stack. This is likely because the managed PInvoke signature
does not match the unmanaged target signature. Check that the calling
convention and parameters of the PInvoke signature match the target
unmanaged signature

IN the line
If OpenPrinter(szPrinterName, hPrinter, 0) Then
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11*********************@e65g2000hsc.googlegro ups.com...
>It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you

Yes, it should work just fine.

AFAIK the .Net 2.0 framework only added more features, it didn't take
any away. (though some were deprecated - but the replacement is
usually mentioned in the warning.)

Thanks,

Seth Rowe
On Mar 16, 10:50 am, "Iouri" <i...@hotsheet.comwrote:
>It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
"Herfried K. Wagner [MVP]" <hirf-spam-me-h...@gmx.atwrote in
messagenews:u7**************@TK2MSFTNGP06.phx.gbl ...
"AHA" <allen.hut...@gmail.comschrieb:
Is it possible in VB.NET to print document using dot matrix printer
as we do with clipper? With Clipper we can set the column and line
printing and also we can eject the printer through the code.
>>HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>
[...]
Wagner, thx for your information. But, if we try to use windows
application, is it possible to print to a pre-printed form as we do
with clipper? How?
Did you take a look at the document I referenced above?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Mar 16 '07 #7
On Mar 16, 11:27 am, "Iouri" <i...@hotsheet.comwrote:
No it does not work. ON this link it is written that it applies to VS2002
and VS2003
In VS2005 I am getting the message

PInvokeStackImbalance was detected
Message: A call to PInvoke function
'WindowsApplication2!WindowsApplication2.RawPrinte rHelper::OpenPrinter' has
unbalanced the stack. This is likely because the managed PInvoke signature
does not match the unmanaged target signature. Check that the calling
convention and parameters of the PInvoke signature match the target
unmanaged signature

IN the line
If OpenPrinter(szPrinterName, hPrinter, 0) Then"rowe_newsgroups" <rowe_em...@yahoo.comwrote in message

news:11*********************@e65g2000hsc.googlegro ups.com...
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
Yes, it should work just fine.
AFAIK the .Net 2.0 framework only added more features, it didn't take
any away. (though some were deprecated - but the replacement is
usually mentioned in the warning.)
Thanks,
Seth Rowe
On Mar 16, 10:50 am, "Iouri" <i...@hotsheet.comwrote:
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
"Herfried K. Wagner [MVP]" <hirf-spam-me-h...@gmx.atwrote in
messagenews:u7**************@TK2MSFTNGP06.phx.gbl. ..
"AHA" <allen.hut...@gmail.comschrieb:
Is it possible in VB.NET to print document using dot matrix printer
as we do with clipper? With Clipper we can set the column and line
printing and also we can eject the printer through the code.
>HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>
[...]
Wagner, thx for your information. But, if we try to use windows
application, is it possible to print to a pre-printed form as we do
with clipper? How?
Did you take a look at the document I referenced above?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Try changing the DllImport from this:

<DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True,
CallingConvention:=CallingConvention.StdCall)_
Public Shared Function OpenPrinter(ByVal src As String, ByRef
hPrinter As IntPtr, ByVal pd As Long) As Boolean
End Function

To this:

<DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)>
_
Private Shared Function OpenPrinter(ByVal pPrinterName As String,
_
ByRef hPrinter As IntPtr, ByVal pd As Integer) As Boolean
End Function

Let me know if it worked.

Thanks,

Seth Rowe

Mar 16 '07 #8
Thank you Seth. It works now

"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11*********************@e1g2000hsg.googlegrou ps.com...
On Mar 16, 11:27 am, "Iouri" <i...@hotsheet.comwrote:
>No it does not work. ON this link it is written that it applies to VS2002
and VS2003
In VS2005 I am getting the message

PInvokeStackImbalance was detected
Message: A call to PInvoke function
'WindowsApplication2!WindowsApplication2.RawPrint erHelper::OpenPrinter'
has
unbalanced the stack. This is likely because the managed PInvoke
signature
does not match the unmanaged target signature. Check that the calling
convention and parameters of the PInvoke signature match the target
unmanaged signature

IN the line
If OpenPrinter(szPrinterName, hPrinter, 0) Then"rowe_newsgroups"
<rowe_em...@yahoo.comwrote in message

news:11*********************@e65g2000hsc.googlegr oups.com...
>It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
Yes, it should work just fine.
AFAIK the .Net 2.0 framework only added more features, it didn't take
any away. (though some were deprecated - but the replacement is
usually mentioned in the warning.)
Thanks,
Seth Rowe
On Mar 16, 10:50 am, "Iouri" <i...@hotsheet.comwrote:
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
"Herfried K. Wagner [MVP]" <hirf-spam-me-h...@gmx.atwrote in
messagenews:u7**************@TK2MSFTNGP06.phx.gbl ...
"AHA" <allen.hut...@gmail.comschrieb:
Is it possible in VB.NET to print document using dot matrix
printer
as we do with clipper? With Clipper we can set the column and
line
printing and also we can eject the printer through the code.
>>HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>
[...]
Wagner, thx for your information. But, if we try to use windows
application, is it possible to print to a pre-printed form as we do
with clipper? How?
Did you take a look at the document I referenced above?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Try changing the DllImport from this:

<DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True,
CallingConvention:=CallingConvention.StdCall)_
Public Shared Function OpenPrinter(ByVal src As String, ByRef
hPrinter As IntPtr, ByVal pd As Long) As Boolean
End Function

To this:

<DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)>
_
Private Shared Function OpenPrinter(ByVal pPrinterName As String,
_
ByRef hPrinter As IntPtr, ByVal pd As Integer) As Boolean
End Function

Let me know if it worked.

Thanks,

Seth Rowe

Mar 16 '07 #9
I have already posted, but do not see it.
It worked perfectly.
Thank you Seth
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11*********************@e1g2000hsg.googlegrou ps.com...
On Mar 16, 11:27 am, "Iouri" <i...@hotsheet.comwrote:
>No it does not work. ON this link it is written that it applies to VS2002
and VS2003
In VS2005 I am getting the message

PInvokeStackImbalance was detected
Message: A call to PInvoke function
'WindowsApplication2!WindowsApplication2.RawPrint erHelper::OpenPrinter'
has
unbalanced the stack. This is likely because the managed PInvoke
signature
does not match the unmanaged target signature. Check that the calling
convention and parameters of the PInvoke signature match the target
unmanaged signature

IN the line
If OpenPrinter(szPrinterName, hPrinter, 0) Then"rowe_newsgroups"
<rowe_em...@yahoo.comwrote in message

news:11*********************@e65g2000hsc.googlegr oups.com...
>It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
Yes, it should work just fine.
AFAIK the .Net 2.0 framework only added more features, it didn't take
any away. (though some were deprecated - but the replacement is
usually mentioned in the warning.)
Thanks,
Seth Rowe
On Mar 16, 10:50 am, "Iouri" <i...@hotsheet.comwrote:
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
"Herfried K. Wagner [MVP]" <hirf-spam-me-h...@gmx.atwrote in
messagenews:u7**************@TK2MSFTNGP06.phx.gbl ...
"AHA" <allen.hut...@gmail.comschrieb:
Is it possible in VB.NET to print document using dot matrix
printer
as we do with clipper? With Clipper we can set the column and
line
printing and also we can eject the printer through the code.
>>HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:http://support.microsoft.com/?scid=kb;EN-US;322090>
[...]
Wagner, thx for your information. But, if we try to use windows
application, is it possible to print to a pre-printed form as we do
with clipper? How?
Did you take a look at the document I referenced above?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Try changing the DllImport from this:

<DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True,
CallingConvention:=CallingConvention.StdCall)_
Public Shared Function OpenPrinter(ByVal src As String, ByRef
hPrinter As IntPtr, ByVal pd As Long) As Boolean
End Function

To this:

<DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)>
_
Private Shared Function OpenPrinter(ByVal pPrinterName As String,
_
ByRef hPrinter As IntPtr, ByVal pd As Integer) As Boolean
End Function

Let me know if it worked.

Thanks,

Seth Rowe

Mar 19 '07 #10

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

Similar topics

1
4130
by: joes | last post by:
Hello there ! I rendering a PDF with XSLT using Xalan and FOP. I like to place in my article an image, so that the text is floating around the image. I tried several things but it didn't work so...
3
22991
by: Xerxes | last post by:
Hi, I need help in setting up a page where the text wraps around an image. Right now, I am using table, with text in one <td> and the image in the adjacent <td>. The problem is when the text is...
2
7555
by: Macsicarr | last post by:
Hi All Wonder if you could help me. I have created a CMS system that allows the user to enter text and pic 'tags' for their own About us page, eg text.... text.... text.... text.......
2
2246
by: Jiri Palecek | last post by:
I have a question on web authoring (probably HTML+CSS). Is it somehow possible to put two words above each other inside a paragraph so the result would be valid and render at least in Mozilla? I...
4
2582
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
3
2551
by: jweinberg1975 | last post by:
I would like for users to be able to select from a small number of options that come from a little drop down menu which then closes. .....
3
2146
by: bbepristis | last post by:
Hey all I have this code that reads from one text file writes to another unless im on a certian line then it writes the new data however it only seems to do about 40 lines then quits and I cant...
3
3960
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
3
2565
by: jonniethecodeprince | last post by:
Hi all, I have trouble getting an array of data stored in a separate javascript file i.e. a file called books.js into a table of data for a .xhtml file. There are 50 Records in this file....
10
3155
by: bluemountain | last post by:
Hi there, Iam new to python forms and programming too I had a text file where i need to extract few words of data from the header(which is of 3 lines) and search for the keyword TEXT1, TEXT2,...
0
6908
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
7043
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
7081
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...
0
6921
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...
0
5336
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
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
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
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.