How can I emulate a 'fake' printer (driver) in Windows?

19

1

For testing, my application needs to send a document to the printer. I don't really want to print this out, so I am looking for a 'fake' printer driver which could essentially print to nothing. I know that nul exists, but I also need the fake printer to support pausing. Any idea if the nul port can do this or any other fake printer driver?

Raymond

Posted 2010-11-29T04:01:01.307

Reputation: 2 101

13why not use the XPS printer driver or an application like CutePDF which emulates a PDF printer ? – Sathyajith Bhat – 2010-11-29T04:03:26.483

2@sathya: Exactly. +1 – Xavierjazz – 2010-11-29T04:20:39.347

@sathya, why not post that as an answer? Seems a lot of people like that idea ;) – nhinkle – 2010-11-29T07:54:31.823

@nhinkle wasn't sure if that was the right option :)) posted as an answer now. – Sathyajith Bhat – 2010-11-29T13:37:21.280

1Because for me it prompts for a dialog for the filename to save as. For testing this won't work for me, but it is a great answer. – Raymond – 2010-11-29T17:43:16.757

PDFCreator can be configured to auto-save documents. – afrazier – 2010-11-30T01:48:11.270

Answers

25

Create a new printer and set its port to NUL:

You will need to add a new local port and just type NUL: where it asks for port name.

New Port

Paused until further notice.

Posted 2010-11-29T04:01:01.307

Reputation: 86 075

How do you pause such a printer or make it offline? – TheCrazyProgrammer – 2016-10-20T19:15:26.443

@TheCrazyProgrammer: In the same manner you'd do so for a real printer. – Paused until further notice. – 2016-10-20T21:05:36.123

6

As I had mentioned in the comments, Windows ( Vista & above) come with a XPS printer driver which you can use. Else install CutePDF which emulates a printer driver.

Sathyajith Bhat

Posted 2010-11-29T04:01:01.307

Reputation: 58 436

5

I recommend the free and open-source PDFCreator

You can pause printing from PDFCreator's control dialog

alt text

netvope

Posted 2010-11-29T04:01:01.307

Reputation: 4 505

1That looks suspiciously like the built-in Windows print dialog... – Hello71 – 2010-11-30T01:22:34.127

1@Hello71 It should, it is the Windows print dialog. A PDF printer like netvope mentioned installs itself as a windows printer and does the work after the document is printed to it. – Tyler Faile – 2011-10-15T03:28:35.063

2

For completeness, Microsoft actually has two different virtual printers included with office, depending on which version of office you use: Microsoft Document Image Writer for Office 2003, and Microsoft XPS Document Writer for Office 2007 and newer.

Of course, like the PDF option these will both still create files on disk. But in the Windows world it's very likely you may already have one of these available.

Joel Coehoorn

Posted 2010-11-29T04:01:01.307

Reputation: 26 787

0

You can use doPDF

doPDF is a free PDF creator that does what the name suggests, creates PDF files. Once installed it will allow you to convert any type of printable documents to PDF files. doPDF7.3 installs itself as a virtual PDF printer driver so after a successful installation will appear in your Printers and Faxes list and also in the list of All Programs. Using doPDF you can convert to PDF in two ways:

  • Print to PDF via the virtual printer driver doPDF. You would do this exactly as you print to a regular printer, just the result will be a PDF file, not a printed piece of paper.
  • Using the doPDF Startup window. doPDF has an executable file (accessible from the start program group) that you can run in order to start a conversion wizard.

enter image description here

rzlines

Posted 2010-11-29T04:01:01.307

Reputation: 7 006