After finishing the previous papers these two days, I flipped out my graduation design and reviewed it.
Virtual printer driver. At that time, I was not very familiar with the role of my own print driver,
What is the difference between the so-called mini-driver and the Microsoft unified driver. It can be said that it was a bit confusing.
We will not discuss the specific implementation details here. We will only analyze them from the perspective of the global architecture.
The relationship between the Windows Printing System and the printer driver.
However, it should be clarified that the printer driver generally includes not only the print driver,
It also includes print processors and even port monitors in the off-line system,
These DLL files, GPD files, Inf files, and so on,
Strictly speaking, the print driver only includes two parts: graphic rendering and user interface.
Use Photoshop to draw a structure diagram:
I don't know why there is a strange plug-in name like "fake offline". anyway, the general structure is like this.
You can write and install the box.
The so-called Microsoft unified driver is the default driver of the system, and the Mini driver is customized on this basis.
Mini drivers include GPD files and resource DLL,
The GPD file is a script that defines the settings that will appear in "Printer Preferences", which are optional.
Resource DLL is a DLL that only contains resources and is provided to GPD to use the resources.
UI-Plugin defines some special settings pages in "Printer Preferences ".
Render-Plugin can perform special processing on the rendering process.
The print processor is responsible for SPL file operations such as EMF and RAW file operations.
Therefore, there are two ways to implement a virtual printer:
First, in the print processor, capture the SPL buffer file and parse it into an EMF file.
Second, it is processed in Render-Plugin to draw the image to other places during graphic rendering, such as a BMP file.