PDF print does not work on Linux WSL2
For Linux Debian, installed as Windows Subsystem for Linux (WSL2), the physical print of any PDF file is completely impossible. Physical machine runs Windows 11. WSL2 machine data:
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Cups version is 2.3.3. Many different ways were tried to print pdf files. Print works successfully for all files, except of PDF. For PDF, print job is successfully sent, but physical print is never done.
Attempts to print PDF with CUPS were done from terminal with different options:
lp -d SHARP_BP-50C26_PCL6_BROWSER test_output.pdflp -d SHARP_BP-50C26_PCL6 -o media=A4 -o sides=one-sided -o media=iso_a4_210x297mm -n 1 test_output.pdf
I provide full CUPS log for command number 1, which does not show any error:
I [21/Jan/2025:11:39:23 +0100] [Job 43] Adding start banner page "none".
I [21/Jan/2025:11:39:23 +0100] [Job 43] Queued on "SHARP_BP-50C26_PCL6" by "root".
I [21/Jan/2025:11:39:23 +0100] [Job 43] File of type application/pdf queued by "root".
I [21/Jan/2025:11:39:23 +0100] [Job 43] Adding end banner page "none".
I [21/Jan/2025:11:39:23 +0100] [Job 43] Started backend /usr/lib/cups/backend/socket (PID 1447)
I [21/Jan/2025:11:39:23 +0100] [Job 43] Job completed.
File test_output.pdf is plain text file, which contains only one line of text. And it is never printed.
Code in C, utilising CUPS functions cupsCreateDestJob, cupsStartDestDocument, cupsWriteRequestData, cupsFinishDestDocument was also wrote and tested. It successfully sends print job, however PDF file is never printed physically.
Printer is SHARP-BP-50C26. On Windows it prints PDF perfectly fine. I tried to add printer from Linux terminal, and then re-add from browser.
In general a lot of ways to print PDF on physical printer were done, respecting official CUPS manual. One could suggest that SHARP printer is not supported on Linux, but this printer works perfectly fine on Linux WSL2 for plain text and for *.png images. So, using Linux is not an issue. Physical print (on paper) fails for PDF only. Logs at /var/log/cups/error_log do not show clear error message. I kindly request for a fix of this issue.
note this is not the development branch for cups. see openprinting.org
-
I recommend you to report your problem here: https://github.com/OpenPrinting/cups/issues
Your chances to get a response from Apple here are very low.
-
When you report it over there, make sure you increase the CUPS log level to "debug". Either edit /etc/cups/cupsd.conf and make sure there is a line
LogLevel debugin there. Your CUPS logging right now is on warning level only, so it is quite useless for debugging stuff like yours.Or run (as root)
cupsctl --debug-logging. (Careful with that: after that command finishes, your cupsd.conf will be stripped from all empty or comment lines and only the bare minimum of configured settings will remain. Better backup your cupsd.conf if you rely on the comments!)