Open xavigutierrez opened 2 years ago
Seeing the same issue. Seriously, do I really have to dig deep into how every package works, just to print a JPEG?
The printer was added to my Ubuntu with:
lpadmin -p HP_InkAdv_2515 -E -v 'ipp://192.168.111.6/ipp/print' -m 'drv:///hpijs.drv/hp-deskjet_2510_series-hpijs.ppd'
The issue is causes by gs
command having inserted a XML tag into it, <</MediaPosition 7>>
:
D [04/Sep/2022:18:28:58 +0200] [Job 2] Starting renderer with command: \"gs -sstdout=%stderr -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -dNOINTERPOLATE -sDEVICE=ijs -sIjsServer=hpijs -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -sDeviceManufacturer=\"HEWLETT-PACKARD\" -sDeviceModel=\"deskjet 5600\" -r300 -sIjsParams=Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2<</MediaPosition 7>>setpagedevice -dIjsUseOutputFD -sOutputFile=%stdout -_\"
This causes the command to get input from a file, and send output to another file.
Shouldn't the variables to be used in command line be filtered, ie. for security reasons? Why we can make CUPS create files within filesystem by giving it parameters in unexpected format?
Found a workaround.
He HP drivers are leaking between each other. Maybe the format is wrong, maybe the parser is bad - either way, CUPS parsers should be able to tell when such things happen.
The workaround is to just cut the specific driver you need. In my case, that is platform codename 'PyramidPlus'.
So I cut it to a separate file (first line - header, 2nd line - the part for specific printer):
grep -B9999 '^Filter ' /usr/share/cups/drv/hpijs.drv | sudo tee /usr/share/cups/drv/hpijs-pyramidplus.drv
grep -A9999 '^\/\/\/.* PyramidPlus' /usr/share/cups/drv/hpijs.drv | grep -B9999 '[}].* PyramidPlus' | sudo tee -a /usr/share/cups/drv/hpijs-pyramidplus.drv
And then I removed my printer and re-added it using the cutout driver:
lpadmin -x HP_InkAdv_2515
lpadmin -p HP_InkAdv_2515 -E -v 'ipp://192.168.111.6/ipp/print' -m 'drv:///hpijs-pyramidplus.drv/hp-deskjet_2510_series-hpijs.ppd'
That solved this issue, because MediaPosition
in that driver is defined properly - the issue was that MediaPosition
from a different driver was used instead, as the various file sections are leaking into each other.
Could you remove your printer and re-add it with
lpadmin -p HP_InkAdv_2515 -E -v 'ipp://192.168.111.6/ipp/print' -m 'drv:///hpcups.drv/hp-deskjet_2510_series.ppd'
Does this work?
The "hpijs" driver of HPLIP is deprecated, you should use "hpcups" instead.
Hi! I am trying to make my HP DeskJet D1600 work with CUPS on a Raspberry Pi, so it can serve the printer (only USB capable) in the local network. Whenever I try to print anything from any client (including the server itself) I get an error that says that filters failed. So, I cranked up the logging level to debug and tried printing a one line text file from command line and found this in
/var/log/cups/error_log
:I can see the following at first sight:
Am I doing something wrong? Did I miss any step? Or is this a bug? Please, let me know if you need additional information. Thanks in advance! Xavier.