Virtual Image Printer Driver Source Code
Virtual Image Printer driver Settings Report Duplicate. Open Hub's statistics are derived from analysis of the project's source code history as maintained by the project's repository. Accordingly, it is crucial that this information be maintained accurately. Image Printer is a, virtual printer driver for computers running Windows 2000, 2003, XP, 2008, Vista, and Windows 7 operating systems based on the Microsoft universal printer driver. It allows you to print any printable document from your computer in a variety of formats.
I'm looking to create a virtual printer that passes data to my .NET application. I want to then create an installer that installs both the printer and the .NET application. It would we really nice to be able to write it all in C#, but I have a feeling that this will require a printer driver to be written is unmanaged code. Does anyone know of a fairly clean tutorial or example of how to do this?
ctrlalt313373ctrlalt313373closed as off-topic by Cody Gray♦Feb 18 at 14:06
This question appears to be off-topic. The users who voted to close gave this specific reason:
- 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.' – Cody Gray
8 Answers
Visit http://www.printerplusplus.com. It is open source .NET virtual printer. It gives you an installer and a .NET class for writing code to process your 'printer data'.
Did exactly what you are asking using the Github project: Microsoft/Windows-driver-samples/print/XPSDrvSmpl
Installer: http://wixtoolset.org/
Application: Listen to internal port
Flow: Install printer and application from a single installer. User prints something with your driver while the application listens to the internal port. When data is sent the application picks it up. This is for XPS, can be converted to PDF, but the flow is similar no matter what you are printing. If you need anything else check out Microsoft/Windows-driver-samples/print/ on GitHub or other sources specific to your needs.
Update:
A lot of questions about how to get the driver working so here is a quick example:
Start by downloading Windows Driver Kit (WDK) if you do not have it installed already. When installing choose to add the extension for Visual Studio as well in the final step. In your Visual Studio 2017 Install you need to have Desktop development with C++
to have the right SDKs. If you don't have it see the anser below on how to add it.
Then download the .zip
file for Windows-driver-samples master:
Navigate to the folder <UnzipFolder>printXPSDrvSmpl
and open XPSDrvSmpl.sln
in Visual Studio.
Then follow Microsofts own guide on GitHub. As you can see it is for Visual Studio 2015 but I think it is the same for 2017 (not tested yet): Drivers free.
To build a driver solution using Windows Driver Kit (WDK) 10 and Visual Studio 2015, perform the following steps.
- Open the solution file in Visual Studio 2015.
- Add all non-binary files (usually located in the install directoryof the sample) to the Package project: a. In the Solution Explorer,right click Driver Files b. Select Add, then click Existing Item c.Navigate to the location to which you downloaded the sample, andselect all the files in the install directory, or the equivalent setof non-binary files such as INFs, INIs, GPD, PPD files, etc. d.Click Add
- Configure these files to be added into the driver package: a. In theSolution Explorer, right click on the solution and choose Add > NewProject. Choose Driver Install Package under Visual C++/WindowsDriver/Package. b. In the Solution Explorer, right click the Packageproject and select Properties. c. In the left pane, clickConfiguration Properties > Driver Install > Package Files. d. In theright pane, use the ellipsis button (..) to browse to the set offiles that needs to be added to the driver package. All the datafiles that you added in Step 2-c, except the INF file, should beadded. This configuration is per-architecture, so this configurationmust be repeated for each architecture that will be built. e. ClickOK.
- Open the INF file and edit it to match the built output. a. Open theINF file. b. In the Version section, add a reference to a catalogfile like this: CatalogFile=XpsDrvSmpl.cat. c. In theSourceDisksFiles section, change the location of the DLL files youare building, to =1. This indicates that there is no architecturespecific directory in this driver. If you ship multiplearchitectures simultaneously, you will need to collate the driverINF manually.
At this point, Visual Studio 2015 will be able to build a driver package and output the files to disk. In order to configure driver signing and deployment, see Developing, Testing, and Deploying Drivers.
OgglasOgglasI think you will have to do a lot of WinAPI wrapping. Start researching on Windows Driver Development Kit to find the things you have to do.
I also found this commercial Printer Driver Resource Toolkit for .NET..
CMSCMSYou could simply have your app expose itself like an LPD type printer or monitor port 9100. You could then install any print driver you like, and point it a your app.
Douglas AndersonDouglas AndersonWas looking for an answer for similar question, and found this link through Wikipedia - http://www.colorpilot.com/emfprinterpilot.html (allows to create Virtual Printers in different languages)
dolzenkodolzenkoWhy not consider using an alternative approach. Like using an intermediate ready made printing program, such as those freely available Print-to-PDF application. Then all you need is to decode PDF using some 3rd party library (which has free and opensource variance too) instead of cracking your head to reinvent the wheel. There are other Print-to-XXX application which you could also consider depending on the format you see fit.
faultyfaultyI don't thing interpreting PDF approach is any good either. I don't know why you want to do what you want to do. Maybe you're trying to write a PDF printer of your own.
I think you should really give the Windows Driver Development thing a look. If you want to develop a printer driver, I think you'll have to do it in C++.
Good Luck.
Cyril GuptaCyril GuptaImage Printer Driver Freeware
If I remember correctly Microsoft does not support .NET within printer driver development. I have yet to come across a pure .NET printer driver. You will be a very brave man to do so! The website 'Printer Driver Resource Toolkit' does not say that the driver has been written in .NET
Not the answer you're looking for? Browse other questions tagged .netvirtualprinting or ask your own question.
The following is a list of Wikipedia articles relating to virtual printer software:
- 2Freeware
- 3Commercial
Free software[edit]
The following are distributed under free software licences:
- CC PDF Converter – Another Ghostscript-based virtual printer, provided by CogniView.
- cups-pdf – Another open source Ghostscript-based virtual printer that can be shared with Windows users over the LAN. Install it on Linux by `yum install cups-pdf ttf-mscorefonts or `apt-get install cups-pdf`. CUPS
- Ghostscript – A command-line library for creation of PostScript and PDF files.
- RedMon – Redirects a special printer port to the standard input of another program.
Freeware[edit]
The following are proprietary software but free of charge:
- Microsoft XPS Document Writer – A virtual printer for Microsoft Windows that creates an XPS (*.xps, *.oxps) document file from the print output of an application.
Virtual PDF printers[edit]
Virtual PDF printers for Microsoft Windows:
- Bullzip PDF Printer - the free version comes with an adware toolbar.
- CutePDF – it tries to install: 1) Ask web browser toolbar, which is well known for browser hijacking, and 2) OpenCandy, a potentially unwanted program.
- DoPDF – this is a simplified version of NovaPDF, which is mentioned below.
- PDFCreator – a Ghostscript-based virtual printer for Microsoft Windows, with user interface for advanced options (security settings, combining multiple documents, etc.). The current and many historic installer versions contain potentially unwanted programs by third parties.
- PDF24 Creator – a free virtual PDF printer for Microsoft Windows, with user interface and additional tools like merging, splitting, compressing and assembling PDF files.
Commercial[edit]
- Adobe Acrobat – Adobe System's commercial PDF authoring suite includes Adobe Distiller, a virtual printer for converting documents to PDF files. Adobe Distiller is not included with the free-to-use Adobe Reader product.
Virtual printers[edit]
Virtual Printer Software
Virtual printers for Microsoft Windows:
It will look like nothing is going on, but it is working. Hp designjet 650c installation software. • At the next window, first click the Windows Update button and wait a few minutes until the list repopulates itself. • Click Next and supply a name for the printer. Once the lists have refreshed, select HP for the Manufacturer and either HP DesignJet 1055CM by Hp or HP DesignJet 1055CM PS3 from Printers.
- Microsoft Office Document Image Writer – Included in Microsoft Office Professional allowing documents to be saved in TIFF or Microsoft Document Imaging Format. MODI is only supported in 32 bit Windows' versions.
- NovaPDF – A PDF virtual printer for Windows.
- Universal Document Converter – Creating PDF, JPEG, TIFF, PNG, GIF, PCX, DCX and BMP files. Free version adds watermark.