Text in .NET

  • Thread starter Thread starter AHA
  • Start date Start date
A

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
 
AHA said:
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
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.
 
HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET


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

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?
 
AHA said:
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?
 
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
Herfried K. Wagner said:
AHA said:
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?
 
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


It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
Herfried K. Wagner said:
AHA said:
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?
 
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.RawPrinterHelper::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 said:
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


It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
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?
 
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.RawPrinterHelper::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

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.)

Seth Rowe
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
message
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?

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
 
Thank you Seth. It works now

rowe_newsgroups said:
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.RawPrinterHelper::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"

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.)

Seth Rowe
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
messagenews:[email protected]...
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?

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
 
I have already posted, but do not see it.
It worked perfectly.
Thank you Seth
rowe_newsgroups said:
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.RawPrinterHelper::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"

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.)

Seth Rowe
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
messagenews:[email protected]...
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?

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
 
Back
Top