简体   繁体   中英

Couldn't open Windows GDI printer driver

I have virtual printer installed which prints through redirected port and sends document to real printer via gsview\\gsprint.exe. It works normally when I use gsprint from a normal C++ application. But if call the same thing through a windows service (run as SYSTEM), it gives following error. It sees the printer but perhaps doesn't have access to it. I am on windows 10 but windows 7 also has the same issue. How can I solve this problem?

2006-02-24 gsprint 1.9 Couldn't open Windows GDI printer driver Requested printer: "SupplyDep"

Available printers: "Send to OneNote 2010" "VirtualPrinter" "SupplyDep" "Microsoft XPS Document Writer" "Fax"

I ran into a similar issue trying to run gsprint as the NT Authority/system user. The last post in this link helped a lot. Basically I setup the printer under my user and then I copied the registry entries for the printer to the default user.

Below are the registry keys I copied from HKEY_CURRENT_USER to HKEY_USERS\.DEFAULT

    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts
    HKEY_CURRENT_USER\Printers

You'll need to restart the Print Spooler service (or just restart the server) in order for the changes to take effect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM