question

AlexCarlock-2314 avatar image
1 Vote"
AlexCarlock-2314 asked Steven-9558 answered

Print to PDF or XPS broken on Windows Server 2019

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-print
image.png (22.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KarlieWeng-MSFT avatar image
0 Votes"
KarlieWeng-MSFT answered

Hello @AlexCarlock-2314

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.


image.png (27.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AlexCarlock-2314 avatar image
0 Votes"
AlexCarlock-2314 answered KarlieWeng-MSFT commented

@KarlieWeng-MSFT,

  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.



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Sorry that didn't help.
Here's a workaround suggested by one user From this thread:
"I found a place to delete the driver manually through help I was getting with a printer issue (I ran "printui.exe /s" then found the driver in the drivers list and removed it). When I got back to adding the "printer" manually, clicking the "Windows Update" button under the list brought it up this time. "




0 Votes 0 ·
AlexCarlock-2314 avatar image
0 Votes"
AlexCarlock-2314 answered KarlieWeng-MSFT commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Alex,

sorry this is bothering you, Is it possible to open a support ticket with Microsoft for this to be solved ?


0 Votes 0 ·
Steven-9558 avatar image
0 Votes"
Steven-9558 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.