[v4 printer driver] How to get full path to the original file from the V4 Printer Drivers

Thoa Phung 1 Reputation point
2022-01-10T06:50:49.623+00:00

Hi,

I'm developing a v4 printer driver. I see an issue that when printing the PDF original file with a size of 1MB, the print spooler converts it to SPL+SHD-> XPS -> the PDF file (increased to 500MB) in the Spool Directory.

The current solution is to get the original file to handle without any transformation involved.

Please let me know how to get the full path to the original file from the V4 Printer Drivers.

Thanks!

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

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,396 Reputation points
    2022-01-11T09:23:04.343+00:00

    Hello ThoaPhung,

    Thank you for your question.

    I can understand you are facing with v4 printer drivers.

    Please note that If you are looking for the original document path (e.g. location of Word Document that you just printed), the spooler will not be able to tell you this.
    The spooler generally receives files through the GDI or XPS paths. The application that does the printing effectively sends the spooler a series of graphical commands (via the appropriate device driver) which the spooler service will cache into a temporary file before sending to the printer. This means the spooler itself does not know anything about the originating source file, or where it is located.

    The driver files gets uploaded/copied to the driver store (which is : %windir%\System32\DriverStore\FileRepository\ )

    https://learn.microsoft.com/en-us/windows/win32/printdocs/doc-info-1?redirectedfrom=MSDN

    ----------------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--


  2. Alan Morris 1,156 Reputation points
    2022-01-26T01:56:42.183+00:00

    @Thoa Phung

    The code path for Type 4 print drivers will be to first generate an XPS formatted spool file.

    All print jobs will first be XPS, then the print filters defined in your driver will be loaded by printfliterpipelinesvc.exe and the XPS file will be converted to the PDL, Printer Description Language, the printer supports.

    When this is a shared printer, since no software is ever copied to a client system when a printer is shared using a Type 4 driver, the client system will bundle up XPS and copy it to the server and the print server will convert the content to PDL.

    Why is the file size causing an issue?

    Are you seeing the XPS spool file at the 500MB or the PDL spool file?

    @Limitless Technology is correct with regard to the driver path, the spooler will load Type 4 print driver directly from the driverstore. There is absolutely no reason to move these files to any other location.
    prn* are the in box drivers.

    Directory of c:\Windows\System32\DriverStore\FileRepository

    11/11/2021 04:16 PM <DIR> prnge001.inf_amd64_1daeee8f3aa30fcb
    11/11/2021 04:16 PM <DIR> prnms001.inf_amd64_8bc1bda6cf47380c
    12/14/2021 08:03 PM <DIR> prnms002.inf_amd64_14b6fbd636fe2b5b
    11/11/2021 04:16 PM <DIR> prnms003.inf_amd64_0e2452f597790e95
    11/11/2021 04:16 PM <DIR> prnms003.inf_x86_360f6f3a7c4b3433
    11/11/2021 04:16 PM <DIR> prnms004.inf_amd64_c28ee88ec1bd4178
    11/11/2021 04:16 PM <DIR> prnms005.inf_amd64_add71423ba73e797
    11/11/2021 04:16 PM <DIR> prnms006.inf_amd64_c3bdcb6fc975b614
    11/11/2021 04:16 PM <DIR> prnms007.inf_amd64_8bbf44975c626ac5
    11/11/2021 04:16 PM <DIR> prnms008.inf_amd64_69b5e0c918eab9a6
    11/11/2021 04:16 PM <DIR> prnms009.inf_amd64_a7412a554c9bc1fd
    11/11/2021 04:16 PM <DIR> prnms010.inf_amd64_9e410195c3b236c9
    11/11/2021 04:16 PM <DIR> prnms011.inf_amd64_f83138380f5fb6ab
    11/11/2021 04:16 PM <DIR> prnms012.inf_amd64_707d3849370b9d23
    12/07/2019 01:13 AM <DIR> prnms013.inf_amd64_2b1aa5c0f193f278
    11/11/2021 04:16 PM <DIR> prnms014.inf_amd64_faec3fc366f8e1fa