Supress Driver Dialoge Promt?
Hey,
I am working with a printer, where every time the print command is sent, a prompt pops up asking for a 'filename'
I am trying to find the best way to hide this from the user, I do not want anything to pop up as it makes the main application unusable until the box is closed. I am just unsure how to go about this as it is coming from the printer driver(my guess).
Any suggestions?
Re: Supress Driver Dialoge Promt?
More information about the kind of printer and code may help us help you.
1 Attachment(s)
Re: Supress Driver Dialoge Promt?
Quote:
Originally Posted by
dbasnett
More information about the kind of printer and code may help us help you.
I am running a test application and right now this is all the code there is :P
vb.net Code:
Imports System.Drawing.Printing
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim x As New PrintDocument
x.Print()
End Sub
End Class
This is what the prompt looks like :
Attachment 99797
The Printer is a wire label printer by Brady
http://www.bradyid.com/bradyid/pdpv/WRAPTOR-PTR.html
Re: Supress Driver Dialoge Promt?
It might help if you actually put something in the document to print. The dialog may be the result of it finding nothing to print!
Re: Supress Driver Dialoge Promt?
Quote:
Originally Posted by
dunfiddlin
It might help if you actually put something in the document to print. The dialog may be the result of it finding nothing to print!
That is what I thought at first too but the dialogue box, shows up in all applications. The filename is the name that shows up on the printer
Even if I use the Labeling software they provided, after hitting print I am prompted for a 'filename'. Same goes for word, paint etc.
Re: Supress Driver Dialoge Promt?
Have you read this?
http://msdn.microsoft.com/en-us/libr....printing.aspx
In the very beginning it says, "Typically, when you print from a Windows Forms application, you create a new instance of the PrintDocument class, set properties, such as DefaultPageSettings and PrinterSettings, that describe how to print, and call the Print method to actually print the document. Calling the PrintDocument.Print method raises the PrintDocument.PrintPage event, which should be handled to perform the document layout for printing.
Use the Graphics property of the PrintPageEventArgs object obtained from the PrintDocument.PrintPage event to specify the output to print. If you are printing a text file, use StreamReader to read one line at a time from the stream and call the DrawString method to draw the line in the graphics object. For more information about this process, see the Graphics and StreamReader classes. You can view an example of printing a text document in the PrintDocument class overview topic."
Re: Supress Driver Dialoge Promt?
Weird. In that case I guess it's firmware so I'm not sure that there's any way to do away with it altogether. It may be possible to fill it in automatically using SendKeys but that's gonna depend on how much information you can get on when it shows. Tricky.
Re: Supress Driver Dialoge Promt?
Quote:
Originally Posted by
dbasnett
Have you read this?
http://msdn.microsoft.com/en-us/libr....printing.aspx
In the very beginning it says, "Typically, when you print from a Windows Forms application, you create a new instance of the PrintDocument class, set properties, such as DefaultPageSettings and PrinterSettings, that describe how to print, and call the Print method to actually print the document. Calling the PrintDocument.Print method raises the PrintDocument.PrintPage event, which should be handled to perform the document layout for printing.
Use the Graphics property of the PrintPageEventArgs object obtained from the PrintDocument.PrintPage event to specify the output to print. If you are printing a text file, use StreamReader to read one line at a time from the stream and call the DrawString method to draw the line in the graphics object. For more information about this process, see the Graphics and StreamReader classes. You can view an example of printing a text document in the PrintDocument class overview topic."
Tried this and same thing.
vb.net Code:
Imports System.Drawing.Printing
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim x As New Printing.PrintDocument
AddHandler x.PrintPage, AddressOf Me.Printh
x.PrinterSettings.PrintFileName = "WAE"
x.Print()
RemoveHandler x.PrintPage, AddressOf Me.Printh
End Sub
Private Sub Printh(ByVal sender As Object, ByVal args As Printing.PrintPageEventArgs)
Static i As Integer = 0
i = i + 1
args.Graphics.DrawString("TEST ", New Font(Me.Font, FontStyle.Regular), Brushes.Black, 10, 10)
End Sub
End Class
Quote:
Originally Posted by
dunfiddlin
Weird. In that case I guess it's firmware so I'm not sure that there's any way to do away with it altogether. It may be possible to fill it in automatically using SendKeys but that's gonna depend on how much information you can get on when it shows. Tricky.
That is my guess too and it is VERY inconvenient.
Ideally, how I want it to work is :
I have a datagridview with a fairly long list. Every time the user changes their selection in the list, a prompt is sent to the printer and the label is ready to print. So to have that pop-up come up and send an escape key every time is the last resort. Will keep messing around with the settings and see if I can take away focus from the pop-up or something
Re: Supress Driver Dialoge Promt?
Does Brady have a support forum? Might get better answers there if they do.
Re: Supress Driver Dialoge Promt?
Quote:
Originally Posted by
dbasnett
Does Brady have a support forum? Might get better answers there if they do.
They dont, but I have been e-mailing their tech support. As of now 'there is no way to bypass that screen'
Hopefully we are able to work something out