Till Kamppeter [Fri, 10 Sep 2021 16:55:55 +0000 (18:55 +0200)]
PPD option preset auto-generator: Added some more option/choice names to check for
Checking the PPD file for the HP LaserJet 4050 (PostScript) found more
option/choice names of options which influence print quality:
- Smoothing
- Halftone
- ProRes(600/1200/2400)
Some other of HPLIP's PostScript PPDs use "HPPJLColorAsGray" with
choices "yes" and "no" instead of ""HPColorAsGray" with "True" and
"False". libcupsfilters: More PPD preset rules, especially for HP
Also analyse choice names for options which contain "Resolution" in
their names.
Till Kamppeter [Wed, 1 Sep 2021 11:21:53 +0000 (13:21 +0200)]
PPD option preset auto-generation for common job IPP attributes
To make the job IPP attributes "print-color-mode", "print-quality",
and "print-content-optimize" actually doing "the right thing" for most
printers we auto-generate PPD option presets now.
CUPS already had the functionality to apply a preset of one or more
PPD option settings for each of the 6 combinations of
"print-color-mode" and "print-quality" settings for longer time but
this was never actually being made use of as it required manually
defining the presets via "APPrinterPreset" PPD attributes. This no one
wants to do with the ~10000 PPDs which come with a typical Linux
distribution nowadays. Even a user with his few print queues does not
want to do it, know how to do it, or know that it is even possible.
This commit makes this fully automatic on every PPD where the presets
are not already manually defined via "APPrinterPreset" attributes.
When creating the PPD cache for a queue's PPD file and the PPD is
without manual presets, it calls the new function
_ppdCacheAssignPresets() which analyses for each PPD option the names
of the choices to find out which choices switch to manochrome or to
color, lower or raise print quality, or improve text/graphics/photo
printing and which are the moset suitable of them. It also analyses
the PostScript/PJL code of the choices to find out whether it affects
the printing resolution.
With this it selects which options get into the the presets and with
which choices.
In addition to presets for the "print-color-mode"/"print-quality"
combos presets for "print-content-optimize" are introduced.
PPD Option settings added by preset are logged on job execution.
Alfonso Gregory [Sat, 28 Aug 2021 16:04:53 +0000 (12:04 -0400)]
Fix undefined behavior regarding pData
pData is a void pointer, and even though the address at request.pData[2] is being cast to that of a const UInt8 pointer, the request.pData has to be converted first BEFORE doing any pointer arithmetic. For this reason, it is best to write this it as a pointer sum, rather than an array.
Without it the printer gets stuck waiting for some kind of USB response from the computer 3/4 into the page. Right at the end of the job.
Sometimes it moves the printing head once every few minutes, if we wait for 20-30 minutes it often finishes correctly. Which is unacceptable.
Using `no-reattach unidir` instead of only `unidir` seems to also work fine, but is seemed superfluous in my case, so try that if things are still wonky.
Disconnecting the USB cable makes it stop the job instantly, spitting the rest of the page.
The same setup works on Windows just fine. Maybe adding the other MP2XX models into the list should be considered.
In my case, until a few months ago printing via CUPS without any kinds of quirks seemed to work fine, so it seems like some kind of regression.
The credit goes to @mounaiban for the original solution:
https://github.com/agalakhov/captdriver/issues/7#issuecomment-602004919
More information here:
https://github.com/agalakhov/captdriver/issues/7#issuecomment-890380405
Michael R Sweet [Mon, 7 Jun 2021 13:16:39 +0000 (09:16 -0400)]
Delete an empty attribute if we aren't able to get the value length, otherwise
the IPP message will contain a truncated attribute that cannot be written
(Issue #195)
Zdenek Dohnal [Wed, 12 May 2021 14:27:21 +0000 (16:27 +0200)]
scheduler/main.c: Set select timeout to JobHistoryUpdate again
The commit 9bdea94b145 introduced a regression in job control and data
files cleanup. If user sets PreserveJobHistory and PreserveJobFiles,
prints a file and stops cupsd before files are cleaned up, the files
aren't removed after cupsd restarts and the timeouts for removal are
reached.
The files will be removed if user uses command 'lpstat -W completed -o'
or by another cupsd restart after time passes JobHistoryUpdate, so
workarounds exist, however the current behavior is strange :( .