Auto print without dialog

Instead of the PrintDialog class, try using the PrintDocument class directly, where you can set the printer by the name: using System.Drawing.Printing; PrintDocument pd = new PrintDocument(); pd.PrinterSettings.PrinterName = “my printer”; To loop through the available printer names: foreach (string s in PrinterSettings.InstalledPrinters) { // }

Connecting and printing to a printer in Java

Some quick hints: print from java: see A Basic Printing Program status of printing job: you might be able to get something useful by using a PrintJobListener: Implementations of this listener interface should be attached to a DocPrintJob to monitor the status of the printer job. These callback methods may be invoked on the thread … Read more

Copy Current Webpage Into a New Window

Perhaps this does the trick (in IE and Firefox, not in Opera. Don’t know about WebKit): var yourDOCTYPE = “<!DOCTYPE html…”; // your doctype declaration var printPreview = window.open(‘about:blank’, ‘print_preview’); var printDocument = printPreview.document; printDocument.open(); printDocument.write(yourDOCTYPE+ “<html>”+ document.documentElement.innerHTML+ “</html>”); printDocument.close(); (Note the difference between window.open() and document.open()!) However, you will lose all custom DOM thingies, … Read more

Printing Excel using Interop

In order to print, you can make use of the Worksheet.PrintOut() method. You can omit any or all of the optional arguments by passing in Type.Missing. If you omit all of them, it will default to printing out one copy from your active printer. But you can make use of the arguments to set the … Read more

Emulate ZPL printer

So, to emulate ZPL printer on your mac (possibly windows too): Install this chrome app Zpl Printer Go to printer settings, add new one. Port can vary. Double-check it. Make sure everything turned on. To test it, try in your terminal: lp -o “raw” -q1 -d zpl <<< “CT~~CD,~CC^~CT~^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR6,6~SD15^JUS^LRN^CI0^XZ^XA^MMT^PW508^LL0203^LS0^BY4,3,138^FT48,155^BCN,,Y,N^FD>;12^FS^PQ1,0,1,Y^XZ” If everything tuned properly, in ZPL … Read more

Python silent print PDF to specific printer

Finally after hours and hours of searching for the right files, i have found the answer to my problem. You can download the GSPRINT in HERE You can download the Ghostscript GPL in HERE With this extracted files in your PC (Windows) you can print your PDF with this command GHOSTSCRIPT_PATH = “C:\\path\\to\\GHOSTSCRIPT\\bin\\gswin32.exe” GSPRINT_PATH = … Read more

Using javascript to print images

Another great solution!! All credit goes to Codescratcher <script> function ImagetoPrint(source) { return “<html><head><scri”+”pt>function step1(){\n” + “setTimeout(‘step2()’, 10);}\n” + “function step2(){window.print();window.close()}\n” + “</scri” + “pt></head><body onload=’step1()’>\n” + “<img src=”” + source + “” /></body></html>”; } function PrintImage(source) { var Pagelink = “about:blank”; var pwa = window.open(Pagelink, “_new”); pwa.document.open(); pwa.document.write(ImagetoPrint(source)); pwa.document.close(); } </script> <a href=”#” onclick=”PrintImage(‘YOUR_IMAGE_PATH_HERE.JPG’); … Read more