I have been hitting walls trying to find the right way to print from a web application. Here is the thing, im implementing a webapplication for a kiosk. The kiosk has its own card printer. When i tested the application using my pc as a server everything worked perfectly. Of course this is because i hadnt realize that the server was the one sending the print promtp to the printer which was ALSO connected to my printer so when i published the application and loaded it on the real server of course it all failed horribly. I was using System.drawing.printing.PrinterSettings.PrinterNam e but what i realized is that this only brings up the names of the printers installed on the server. And logically like the card printer isnt installed in the server it cant find it. What the hell can i do to make my application print on the client side ? Here is what i am printing, i used e.graphics to print what i needed.
printdoc.PrinterSettings.PrinterName = "Zebra P110i USB Card Printer"
AddHandler printdoc.PrintPage, AddressOf printdoc_PrintPage
printdoc.Print()
Private Sub printdoc_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
Dim cardSize As New System.Drawing.Rectangle(0, 0, 345, 212)
e.Graphics.DrawImage(System.Drawing.Image.FromFile ("\tarjeta2.tif", True), cardSize)
e.Graphics.DrawString(gname, New System.Drawing.Font("Arial", 10.0F), Drawing.Brushes.White, New System.Drawing.PointF(130.0F, 173.0F))
e.Graphics.DrawString("www.gestamotors.com Tel: (81) 8128-5000", New System.Drawing.Font("ArialNarrow", 7.5), Drawing.Brushes.DarkSlateGray, New System.Drawing.PointF(120.0F, 193.0F))
e.Graphics.DrawString("*" & gcard & "*", New System.Drawing.Font("IDAutomationHC39M", 8.0F), System.Drawing.Brushes.Black, New System.Drawing.PointF(8.0F, 162.0F))
End Sub