system.printing

Is there a way to check if a printing process was successful?

若如初见. 提交于 2019-12-03 02:10:40
I have an application where I need to print a ticket. Each ticket must be unique. The application is windows forms and written entirely in c#. For our application we're using Samsung ML- 2525 laser monochromatic printers. The flow is basically the following, the operator picks a product/ticket (which is unique) and then it presses a button that does 2 things: Connects to a database and updates the product as used Prints the ticket (this is done using System.Drawing and GDI+) For some reason, every once in a while, the image that needs to be printed is not sent to the printer. It's a rare case,

Maximize Print Preview?

风流意气都作罢 提交于 2019-12-01 13:36:18
Is there any way to Maximize the Print Preview Dialogue? I could not see any Maximize property on the controls at properties window. It's not available in the properties page because you have to cast the PrintPreviewDialog to a Form in order to access those Form properties: DirectCast(PrintPreviewDialog1, Form).WindowState = FormWindowState.Maximized For C#: (PrintPreviewDialog1 as Form).WindowState = FormWindowState.Maximized; 来源: https://stackoverflow.com/questions/22381762/maximize-print-preview

Maximize Print Preview?

℡╲_俬逩灬. 提交于 2019-12-01 11:41:36
问题 Is there any way to Maximize the Print Preview Dialogue? I could not see any Maximize property on the controls at properties window. 回答1: It's not available in the properties page because you have to cast the PrintPreviewDialog to a Form in order to access those Form properties: DirectCast(PrintPreviewDialog1, Form).WindowState = FormWindowState.Maximized 回答2: For C#: (PrintPreviewDialog1 as Form).WindowState = FormWindowState.Maximized; 来源: https://stackoverflow.com/questions/22381762

Printing from ASP.NET to a network printer

て烟熏妆下的殇ゞ 提交于 2019-11-27 08:08:11
I need to send documents to a network printer (\myserver\myprinter). I'm using the System.Printing classes to print, and it works fine when it's from a Windows Service, but from an ASP.NET app, it's only able to print to local printers, not network printers. The error I'm getting is "Printer Name is not valid" This is what I'm using to get the printer name: public string PrinterName { using (LocalPrintServer server = new LocalPrintServer()) return server.GetPrintQueue(@"\\myserver\myprinter"); } What are my options here? Is this a permissions problem? There are issues with credentials that you

Display special characters using System.out.println

自古美人都是妖i 提交于 2019-11-26 22:45:41
I'm having trouble sending or displaying text with special characters from my webservice to my database. On my eclipse I have set the character encoding to UTF-8 but it still doesn't let me display the characters. For example a simple print like the code below String test ="привет"; System.out.println(test); OR String test ="привет"; String query = "insert into communication (`test`) VALUES ('"+ test +"'); PreparedStatement preparedStmt1 = con.prepareStatement(query); preparedStmt1.executeUpdate(); The result on the console and if I send this to my database is ??????. How do I get this to

Printing from ASP.NET to a network printer

本秂侑毒 提交于 2019-11-26 17:44:32
问题 I need to send documents to a network printer (\myserver\myprinter). I'm using the System.Printing classes to print, and it works fine when it's from a Windows Service, but from an ASP.NET app, it's only able to print to local printers, not network printers. The error I'm getting is "Printer Name is not valid" This is what I'm using to get the printer name: public string PrinterName { using (LocalPrintServer server = new LocalPrintServer()) return server.GetPrintQueue(@"\\myserver\myprinter")