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
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
> 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
> > Hi,
> > > I am trying to use the PrintDocument control to send control codes
> > > 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
> > It would be helpful to include at least the line of code which incurs
> > 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
> > Visit http://www.microsoft.com/security for current information on