Print to PDF or XPS broken on Windows Server 2019

Alex Carlock 201 Reputation points
2021-02-12T23:51:05.163+00:00

We have a Windows Server 2019 instance that we use as a Remote Desktop server. Until today, people could print to PDF. Suddenly today the Print button Preferences button, and options are greyed out and cannot be clicked. Someone online suggested removing and reinstalling the Microsoft Print to PDF printer. I was able to remove it using Device Manager, but when I try to reinstall it (manually adding a printer, selecting PORTPROMPT: (Local Port) as the port, and the Microsoft Print to PDF driver), I get an error: "Unable to install printer. The handle is invalid." I uninstalled some recently installed updates (a newer version of KB4598230 and then KB4598230), but that didn't help. We also have OneNote installed on the computer and printing to that doesn't work either (same greyed out Print button). Regular physical printers do work. I can't find anything helpful online. SFC /ScanNow didn't find any issues.

Thoughts?

67591-image.png

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
675 questions
0 comments No comments
{count} vote

4 answers

Sort by: Most helpful
  1. Karlie Weng 18,276 Reputation points Microsoft Vendor
    2021-02-15T06:57:06+00:00

    Hello @Alex Carlock

    Did the printer troubleshooter report any issues?
    Before re-installing , did you try stopping spooler service ?
    Please try turn off Microsoft Print to PDF feature and turn it on again.

    68024-image.png

    Reference thread :The Handle is invalid when adding Microsoft Print to PDF

    Best Regards
    Karlie

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Alex Carlock 201 Reputation points
    2021-02-15T14:18:09.3+00:00

    @Karlie Weng ,

    1. I don't remember if we ran the troubleshooter before uninstalling the printers. It doesn't find any issues now.
    2. Yes, we tried stopping/restarting the spooler service. If I stop it while installing the printer, I get an error that "The local print spooler service is not running. Pleas restart the spooler or restart the machine"
    3. Windows Server 2019 does not have the same Control panel item for turning the Print to PDF feature Off and On, but I used powershell to try. I'm able to uninstall it, but when I try to reinstall it, I get "Enable-WindowsOptionalFeature : Enable-WindowsOptionalFeature failed. Error code = 0x800f0922"

    I saw that article and nothing in it helped.


  3. Alex Carlock 201 Reputation points
    2021-02-23T13:41:28.95+00:00

    Thanks for the thought, but I just tried and it didn't help. First I told windows to delete the driver but safe the files (for the XPS printer), then I told windows to delete everything. When I run Windows Update on this Server the XPS and PDF drivers don't show up. I still see the XPS driver in the installed drivers, and when I select it, I get the same error messages. When I try to re-install the PDF printer, I don't see the drivers installed locally (Makes sense becuase I told windows to fully delete them), and Windows Update doesn't find them. Now I don't have drivers I can even try to re-install.


  4. Steven 1 Reputation point
    2021-03-08T23:27:33.92+00:00

    NOTE: our configuration is a little different. We are running windows server 2012 R2 (Now with all the latest updates) and Windows 10 1909 or windows 10 20h2 with all the latest updates.
    We had removed the updates from the server in November to regain functionality. About 2 weeks ago an update installed to our windows 10 workstations that broke this again. After testing, I found that Remote pdf printing now works if both the servers and workstations are updated.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.