Before Printing does application/Windows convert any document to PS/PCL before sending it to Printer?

Strawhat007 40 Reputation points
2023-03-22T05:08:05.9666667+00:00

Hi,

I want to know, when we click on the PrintDialog button for printing through MS Word or any other Application and then we select and customize the printer properties and it is send to print queue for printing. Does windows or the application from which it is printing from convert the file (like txt, pdf etc. ) to PCL/XPS or something ?
How does windows process the document to the printer ?

Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
643 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 81,831 Reputation points
    2023-03-22T07:24:28.9333333+00:00

    Printing is complex.

    It is detailed in old Feng Yuan book "Windows Graphics Programming Win32 GDI and DirectDraw" :

    17.1 UNDERSTANDING THE SPOOLER

    The Windows printing system is a complicated subsystem of the whole graphics system. Although to a normal user or even a programmer, the complexity of the printing system is not so obvious, when there are really hard printing-related problems to solve, you will start to know a long list of components in the printing system and their interactions.

    Section 2.4 of this book gives a detailed description of the printing subsystem architecture. There is a long list of components in the printing subsystem. The better-known players in printing are the user application, GDI, Windows graphics engine, printer driver, and the actual printer. The lesser-known components are the spooler process, spooler client DLL, spooler router, print provider, print processor, language monitor, port monitor, and the port IO driver.

    Instead of discussing these components in more detail, we will focus in this section on the relationship between normal Windows applications and the printing subsystem.

    Printing Process

    Printing even a simple job in the Windows operating system is quite an involved process. Over a dozen steps are involved from initially querying for a printer to actually finishing a print job. Here is a summary of the process.

    The application queries the Win32 spooler client DLL, either through spooling functions or through printing-related common dialog boxes, to find information about current printers. Printing common dialog boxes provides an easy way to use the wrapper around the spooler API.

    Win32 spooler client DLL is a user-mode DLL that provides the application and the user-interface portion of a printer driver, which can be used to query about printers, printing jobs, printing settings, etc.

    Once the printing setting is negotiated, the application sends a printing job to the system, using GDI commands. A few special GDI commands are used to signal the start and end of a printing job, and to divide a document in pages.

    GDI accepts the GDI drawing command from the application, writing into the EMF spool file, and passes the spool file to the spooler process.

    The spooler process is a system service that manages spooling and despooling of printing jobs. The spooler client DLL talks to it through remote procedure calls. The spooler passes the job to the spooler router.

    The spooler router is responsible for find the right print provider to handle a printing job.

    The print provider is responsible for directing the printing job to the right machine physically connected with a printer, which can be a local machine or a remote machine. It also manages the print-job queue, and implements the API that starts, stops, or enumerates printing jobs. The operating system provides the local print provider, Windows network print provider, Novell Netware print provider, and the HTTP print provider. If the printer is not on the local machine, a network print provider is responsible for sending the job over the network. The job is finally handled by a local print provider, which passes the job to a print processor.

    The print processor is responsible for converting the spooled printing file into a raw data format that can be processed directly by a printer. The most commonly used print processor on Windows 2000 is the EMF print processor that is part of the local print provider.

    The print processor calls GDI to despool the EMF-spool file to a real printer driver device context.

    The windows graphics engine calls the printer driver to implement the GDI drawing command sent to a printer device context, and supports possible rendering required by printer driver.

    The printer driver is responsible for translating the DDI (device driver interface) level drawing primitives to raw data acceptable by the printer. The printer driver writes raw data back to the spooler.

    The spooler passes raw data to a language monitor, which is responsible to provide a full-duplex communication channel between the spooler and printer. A language monitor passes the data to a port monitor.

    A port monitor provides a communication path between the spooler and a kernel-mode port I/O driver, which really has access to the hardware I/O port linked to a printer.

    The port I/O driver sends data from the host machine to the printer. It also receives status information from the printer and passes it back to the port monitor and language monitor.

    The printer firmware running on an embedded CPU in the printer receives data from the printer's I/O port, uncompresses and processes it to a format suitable for driving the printing cartridge, and controls countless mechanical, electrical, and electronics components in the printer to put real dots on a piece of paper. A printer may have a high-powered RISC CPU, tons of memory, a hard disk, and be supported by a real-time multitasking operating system and a sophisticated firmware.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful