PrintDocument control and Generic/Text Only Driver

PrintDocument control and Generic/Text Only Driver

Post by Nicholas A. Foste » Thu, 30 May 2002 06:40:37



I am trying to use the PrintDocument control to send control codes (pure
text) to barcode printers using the generic / text only driver. Has anybody
managed to use this driver with the PrintDocument control?

I get the error:

An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.drawing.dll

Additional information: The data area passed to a system call is too small

Thanks in advance

 
 
 

PrintDocument control and Generic/Text Only Driver

Post by John Hornick [M » Thu, 30 May 2002 07:31:36


Hi,

Quote:> I am trying to use the PrintDocument control to send control codes (pure
> text) to barcode printers using the generic / text only driver. Has
anybody
> managed to use this driver with the PrintDocument control?

> I get the error:

> An unhandled exception of type 'System.ComponentModel.Win32Exception'
> occurred in system.drawing.dll

> Additional information: The data area passed to a system call is too small

It would be helpful to include at least the line of code which incurs the
exception when making a post like this. Ideally, you'd also include the
values of the parameters, etc..

I think you'll need to interop with Win32's WritePrinter() to send your
raw data to the printer.

Thanks,
- John
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.

 
 
 

PrintDocument control and Generic/Text Only Driver

Post by Dan Tage » Fri, 28 Jun 2002 23:25:42


I am having the same problem, here is my code...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim p As New PrintDocument()

p.PrinterSettings.PrinterName = "genericprinter"

AddHandler p.PrintPage, AddressOf p_PrintPage

p.Print()

End Sub

"genericprinter" is using the generic/text only driver.
When p.print is executed, I get the error message.
If I change the printer to use any driver that supports graphics it works
fine.



Quote:> Hi,

> > I am trying to use the PrintDocument control to send control codes (pure
> > text) to barcode printers using the generic / text only driver. Has
> anybody
> > managed to use this driver with the PrintDocument control?

> > I get the error:

> > An unhandled exception of type 'System.ComponentModel.Win32Exception'
> > occurred in system.drawing.dll

> > Additional information: The data area passed to a system call is too
small

> It would be helpful to include at least the line of code which incurs the
> exception when making a post like this. Ideally, you'd also include the
> values of the parameters, etc..

> I think you'll need to interop with Win32's WritePrinter() to send your
> raw data to the printer.

> Thanks,
> - John
> Microsoft Developer Support
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Visit http://www.microsoft.com/security for current information on

security.
 
 
 

PrintDocument control and Generic/Text Only Driver

Post by Chris J Breisc » Sun, 30 Jun 2002 01:32:37


I have done a little investigating on the net.  Several people (including
me) are having this problem.  There appears to be a general problem with the
Generic Printer Driver and .NET.

The error occurs in
system.drawing.dll!System.Drawing.Printing.StandardPrintController::OnStartP
age()

or in whatever PrintController you are using...it's the OnStartPage method.

Chris J. Breisch, MCSD, MCDBA


> I am having the same problem, here is my code...

> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click

> Dim p As New PrintDocument()

> p.PrinterSettings.PrinterName = "genericprinter"

> AddHandler p.PrintPage, AddressOf p_PrintPage

> p.Print()

> End Sub

> "genericprinter" is using the generic/text only driver.
> When p.print is executed, I get the error message.
> If I change the printer to use any driver that supports graphics it works
> fine.



> > Hi,

> > > I am trying to use the PrintDocument control to send control codes
(pure
> > > text) to barcode printers using the generic / text only driver. Has
> > anybody
> > > managed to use this driver with the PrintDocument control?

> > > I get the error:

> > > An unhandled exception of type 'System.ComponentModel.Win32Exception'
> > > occurred in system.drawing.dll

> > > Additional information: The data area passed to a system call is too
> small

> > It would be helpful to include at least the line of code which incurs
the
> > exception when making a post like this. Ideally, you'd also include the
> > values of the parameters, etc..

> > I think you'll need to interop with Win32's WritePrinter() to send your
> > raw data to the printer.

> > Thanks,
> > - John
> > Microsoft Developer Support
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > Visit http://www.microsoft.com/security for current information on
> security.

 
 
 

PrintDocument control and Generic/Text Only Driver

Post by Steve Smit » Sat, 13 Jul 2002 19:39:44


I'm another one having these problems (from C#, in my case).  Anybody had
any luck with this yet?

Steve



Quote:> I have done a little investigating on the net.  Several people (including
> me) are having this problem.  There appears to be a general problem with
the
> Generic Printer Driver and .NET.

> The error occurs in

system.drawing.dll!System.Drawing.Printing.StandardPrintController::OnStartP
> age()

> or in whatever PrintController you are using...it's the OnStartPage
method.

> Chris J. Breisch, MCSD, MCDBA



> > I am having the same problem, here is my code...

> > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles Button1.Click

> > Dim p As New PrintDocument()

> > p.PrinterSettings.PrinterName = "genericprinter"

> > AddHandler p.PrintPage, AddressOf p_PrintPage

> > p.Print()

> > End Sub

> > "genericprinter" is using the generic/text only driver.
> > When p.print is executed, I get the error message.
> > If I change the printer to use any driver that supports graphics it
works
> > fine.



> > > Hi,

> > > > I am trying to use the PrintDocument control to send control codes
> (pure
> > > > text) to barcode printers using the generic / text only driver. Has
> > > anybody
> > > > managed to use this driver with the PrintDocument control?

> > > > I get the error:

> > > > An unhandled exception of type

'System.ComponentModel.Win32Exception'

- Show quoted text -

Quote:> > > > occurred in system.drawing.dll

> > > > Additional information: The data area passed to a system call is too
> > small

> > > It would be helpful to include at least the line of code which incurs
> the
> > > exception when making a post like this. Ideally, you'd also include
the
> > > values of the parameters, etc..

> > > I think you'll need to interop with Win32's WritePrinter() to send
your
> > > raw data to the printer.

> > > Thanks,
> > > - John
> > > Microsoft Developer Support
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > Visit http://www.microsoft.com/security for current information on
> > security.

 
 
 

PrintDocument control and Generic/Text Only Driver

Post by Steve Smi » Sun, 14 Jul 2002 22:51:33


A known issue with an estimated fix date or a known issue with no sign
of a fix?



>Hi,

>> I'm another one having these problems (from C#, in my case).  Anybody had
>> any luck with this yet?

>This is a known issue.

>Thanks,
>- John
>Microsoft Developer Support
>This posting is provided "AS IS" with no warranties, and confers no rights.
>Visit http://www.microsoft.com/security for current information on security.

[ remove the crosses from my e-mail address before replying ]
 
 
 

PrintDocument control and Generic/Text Only Driver

Post by John Hornick [M » Sun, 14 Jul 2002 23:49:47


Hi,

Quote:> A known issue with an estimated fix date or a known issue with no sign
> of a fix?

> >> I'm another one having these problems (from C#, in my case).  Anybody
had
> >> any luck with this yet?

> >This is a known issue.

At this point, I'd have to lean toward the latter.

Thanks,
- John
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.

 
 
 

1. Printing using the generic/text only print driver

When attempting to print to a printer that is using the generic/text only
driver, I get the following error when the
PrintDocument.Print() function is called.
 An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.drawing.dll
Additional information: The data area passed to a system call is too small

Code...

Dim p As New PrintDocument()

p.PrinterSettings.PrinterName = "genericprinter"  'uses "generic/text only"
windows printer driver

AddHandler p.PrintPage, AddressOf p_PrintPage

p.Print()

Anyone know if this is a bug/known issue?

2. cisco interactive mentor I need it!!

3. Text Driver that supports mlti byte

4. auto_undo<>

5. Generic Text Printing

6. NM 2.1 broken

7. Unhandled exception on OleDbDataAdapter.Fill method using Jet driver and text/.csv data file

8. Upgrade from EP 4.2.2

9. OleDb vs. ODBC text driver

10. Printing to pdf driver (acrobat5) garbled text

11. Looking for Text Driver which suppots Multibyte Character.

12. Text driver for OLE DB