Stop print driver from opening windows

07
2014-07
  • Nerdrage87

    A program I've written is being used to send shipping labels to a label printer - or, more precisely, to five printers, each on a separate driver I've set up. The throughput is one every three seconds for each printer, so there's a lot of windows popping up that say "Printing - Page 1 of document" - sometimes for all five printers at once - and we're planning to extend the program to 10 printers. Is there any way get the drivers configured to not show this window? The program and drivers are on a computer running Windows Server 2012 R2. The driver is for InterMec px4i printers, and I'm using System.Drawing.Printing under C# .NET 4.0.

    http://i.stack.imgur.com/robgy.jpg

  • Answers
  • Nerdrage87

    As it turns out, it is the default print controller itself that causes the window to appear. System.Drawing.Printing gives all new PrintDocuments the default print controller. When setting up the page to print, my program goes through the following statements:

        PrintDocument pd = new PrintDocument();
        pd.PrinterSettings.PrinterName = PrinterName;
        ...
    

    What I did to solve the problem was to give it a new print controller using the default constructor:

        pd.PrintController = new StandardPrintController();
    

    Now there are no "Printing..." windows popping up, and this has also visibly increased the performance of my program. I hope this helps anyone else having this problem, but it should probably be moved to StackOverflow as it is a programming problem, not a windows problem.


  • Related Question

    drivers - How to print documents to pictures (gif, bmp etc.) on windows
  • hstoerr

    What is the easiest way to capture the printout of a document in a picture (i.e. GIF, BMP etc.)? Making a screenshot does not help, since the printout is different and larger than the screen. Is there a special printer driver for windows that captures the printout into pictures?


  • Related Answers
  • alex

    You can use PDFCreator. It's free and open source. Here's a bit more info on it:

    • Create PDFs from any program that is able to print Security: Encrypt PDFs and protect them from being opened, printed etc
    • New: Digitally sign your PDFs to ensure that you are the author and the file has not been modified
    • New: Create PDF/A files for long term archives
    • Send generated files via eMail
    • Create more than just PDFs: PNG, JPG, TIFF, BMP, PCX, PS, EPS
    • AutoSave files to folders and filenames based on Tags like Username, Computername, Date, Time etc.
    • Merge multiple files into one PDF Easy Install: Just say what you want and everything is installed
    • Terminal Server: PDFCreator also runs on Terminal Servers without problems
    • And the best: PDFCreator is free, even for commercial use! It is Open Source and released under the Terms of the GNU General Public License.
  • outsideblasts

    What is the easiest way to capture the printout of a document in a picture (i.e. GIF, BMP etc.)? Making a screenshot does not help

    oh yes, it does .... if you have the right software :)

    Faststone Capture does exactly what you want:

    Capture windows, objects, menus, full screen, rectangular/freehand regions and scrolling windows/web pages

    Faststone Capture version 5.3 is free, and so is its portable variant.