Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-04 Thread Yves-Alexis Perez
Package: cups-filters
Version: 1.27.0-2
Severity: important

Hi,

since “some” time (few weeks maybe, I guess the 1.27.0 upload), I can't
print on my Brother HL-5250DN network printer (which was working just
fine earlier).

The printer is laser monochrome, and I always was able to print color
and monochrome stuff, conversion was happening just fine.

Now, when I try to print, nothing happens and I guess an error in the
logs about:

W [04/Feb/2020:21:28:45 +0100] [Job 570] Grayscale/monochrome printing
requested for this job but Poppler is not able to convert to
grayscale/monochrome PostScript.
W [04/Feb/2020:21:28:45 +0100] [Job 570] Use \"pdftops-renderer\" option
(see README file) to use Ghostscript or MuPDF for the PDF -> PostScript
conversion.

First, it's really not obvious from the log *which* README this is
about, and I had to dig a little before finding it was the one from
cups-filters.

Then, I tried to set pdftops-renderer-default to various options (gs,
pdftocairo) using:

lpadmin -p printer -o pdftops-renderer-default=

but it didn't work.

With:

- gs: nothing prints, but nothing happens in the logs
- pdftocairo: same error message than without any option
- pdftops: same error

With mupdf it does send something to the printer but the results shows:

ERROR NAME;
  undefined
COMMAND;
  °
OPERAND STACK;

and in the logs I get:

W [04/Feb/2020:21:34:29 +0100] [Job 573] Level 3 PostScript not
supported by mutool.

Downgrading to 1.26.2 from testing seems to fix the problem (I still
have the log entry, though, it seems, so maybe it's unrelated).

Regards,

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (450, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.4.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8), 
LANGUAGE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cups-filters depends on:
ii  bc 1.07.1-2+b2
ii  cups-filters-core-drivers  1.27.0-2
ii  ghostscript9.50~dfsg-5
ii  libc6  2.29-9
ii  libcups2   2.3.1-4
ii  libcupsfilters11.27.0-2
ii  libfontconfig1 2.13.1-2+b1
ii  libfontembed1  1.27.0-2
ii  libgcc-s1 [libgcc1]10-20200202-1
ii  libgcc11:9.2.1-25
ii  libqpdf26  9.1.1-1
ii  libstdc++6 10-20200202-1
ii  poppler-utils  0.71.0-6

Versions of packages cups-filters recommends:
ii  colord 1.4.4-1
ii  liblouis-bin   3.12.0-3
ii  liblouisutdml-bin  2.8.0-3

Versions of packages cups-filters suggests:
pn  antiword   
pn  docx2txt   
pn  foomatic-db-compressed-ppds | foomatic-db  
ii  imagemagick8:6.9.10.23+dfsg-2.1+b2
ii  imagemagick-6.q16 [imagemagick]8:6.9.10.23+dfsg-2.1+b2

-- Configuration Files:
/etc/modules-load.d/cups-filters.conf changed:


-- no debconf information


Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Brian Potkin
tags 950690 upstream
thanks


On Tue 04 Feb 2020 at 21:42:03 +0100, Yves-Alexis Perez wrote:

> Package: cups-filters
> Version: 1.27.0-2
> Severity: important
> 
> Hi,
> 
> since “some” time (few weeks maybe, I guess the 1.27.0 upload), I can't
> print on my Brother HL-5250DN network printer (which was working just
> fine earlier).
> 
> The printer is laser monochrome, and I always was able to print color
> and monochrome stuff, conversion was happening just fine.
> 
> Now, when I try to print, nothing happens and I guess an error in the
> logs about:
> 
> W [04/Feb/2020:21:28:45 +0100] [Job 570] Grayscale/monochrome printing
> requested for this job but Poppler is not able to convert to
> grayscale/monochrome PostScript.
> W [04/Feb/2020:21:28:45 +0100] [Job 570] Use \"pdftops-renderer\" option
> (see README file) to use Ghostscript or MuPDF for the PDF -> PostScript
> conversion.
> 
> First, it's really not obvious from the log *which* README this is
> about, and I had to dig a little before finding it was the one from
> cups-filters.
> 
> Then, I tried to set pdftops-renderer-default to various options (gs,
> pdftocairo) using:
> 
> lpadmin -p printer -o pdftops-renderer-default=
> 
> but it didn't work.
> 
> With:
> 
> - gs: nothing prints, but nothing happens in the logs
> - pdftocairo: same error message than without any option
> - pdftops: same error
> 
> With mupdf it does send something to the printer but the results shows:
> 
> ERROR NAME;
>   undefined
> COMMAND;
>   °
> OPERAND STACK;
> 
> and in the logs I get:
> 
> W [04/Feb/2020:21:34:29 +0100] [Job 573] Level 3 PostScript not
> supported by mutool.
> 
> Downgrading to 1.26.2 from testing seems to fix the problem (I still
> have the log entry, though, it seems, so maybe it's unrelated).

Thank you for your report, Yves-Alexis.

Your issue seems connected with

 https://github.com/OpenPrinting/cups-filters/issues/169

and its associated bugs. I take it you are using the PostScript
PPD provided by Brother. I did test how filtering went with it
and a file or two. I got no errors, but did get the warnings you
got. Then again, I do not have the printer to print the output
file to.

I am not sure I really understand all that is involved here, so,
because you are able to provide first-hand experience, suggest
you forward the issue upstream.

Regards,

Brian.



Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Yves-Alexis Perez
On Wed, Feb 05, 2020 at 03:29:22PM +, Brian Potkin wrote:
> Your issue seems connected with
> 
>  https://github.com/OpenPrinting/cups-filters/issues/169
> 
> and its associated bugs.

When looking at the warning message in the logs I stumbled on that bug,
but didn't really find it really informative (especially since it's
closed while I still have the bug).

> I take it you are using the PostScript
> PPD provided by Brother. 

Not really sure, but I don't think so. I mean, I'm using the PPD file
from cups Debian packages, not anything from Brother.

> I did test how filtering went with it
> and a file or two. I got no errors, but did get the warnings you
> got. Then again, I do not have the printer to print the output
> file to.

Not entirely sure what is your workflow here, but with some details
maybe I can try to reproduce what you did and see if something goes out
of the printer?
> 
> I am not sure I really understand all that is involved here, so,
> because you are able to provide first-hand experience, suggest
> you forward the issue upstream.

Just to be sure: do you mean opening a new issue on upstream github, or
just commenting on the issue linked above?

Regards,
-- 
Yves-Alexis



Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Brian Potkin
On Wed 05 Feb 2020 at 17:18:28 +0100, Yves-Alexis Perez wrote:

> On Wed, Feb 05, 2020 at 03:29:22PM +, Brian Potkin wrote:
> > Your issue seems connected with
> > 
> >  https://github.com/OpenPrinting/cups-filters/issues/169
> > 
> > and its associated bugs.
> 
> When looking at the warning message in the logs I stumbled on that bug,
> but didn't really find it really informative (especially since it's
> closed while I still have the bug).

I think using gs as the renderer is regarded as the fix but, TBH, I got
a little lost when I started looking at the bugs linked from #169.

> > I take it you are using the PostScript
> > PPD provided by Brother. 
> 
> Not really sure, but I don't think so. I mean, I'm using the PPD file
> from cups Debian packages, not anything from Brother.

As root, what do you get for

 grep "*NickName" /etc/cups/ppd/

Do you know the package name?

> > I did test how filtering went with it
> > and a file or two. I got no errors, but did get the warnings you
> > got. Then again, I do not have the printer to print the output
> > file to.
> 
> Not entirely sure what is your workflow here, but with some details
> maybe I can try to reproduce what you did and see if something goes out
> of the printer?

Later, certainly. I'd like to test with your PPD first. 

> > I am not sure I really understand all that is involved here, so,
> > because you are able to provide first-hand experience, suggest
> > you forward the issue upstream.
> 
> Just to be sure: do you mean opening a new issue on upstream github, or
> just commenting on the issue linked above?

Open a new issue referring to #169 and referencing the Debian report.

Regards,

Brian.



Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Brian Potkin
On Wed 05 Feb 2020 at 17:19:31 +, Brian Potkin wrote:

> Open a new issue referring to #169 and referencing the Debian report.

Sorry; I should have suggested leaving doing this until we both have had
the opportunity to test the filtering system.

Regards,

Brian.



Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Till Kamppeter
The warning about not being able to convert color input into grayscale 
is principally no problem for you, as monochrome PostScript printers can 
receive color input without any problems, they convert the input by 
themselves.


What this warning tells to me is that you upgraded from a cups-filters 
version from before the fix of this issue


https://github.com/OpenPrinting/cups-filters/issues/169
   PS Level 1 forced for grayscale PDF rendering with Poppler/Cairo

to one afterwards.

Without the fix of this issue your printer had most probably received 
PostScript Level 1 and happily printed it.


Now it is receiving PostScript Level 2.

Brother PostScript printers are known to have many bugs in their 
PostScript interpreters and therefore we have already a big bunch of 
workarounds in our pdftops filter.


Probably the best is to try to print without using PostScript. When 
creating a print queue and selecting your printer's make, model, and 
driver manually, have a look at PCL 6/XL (pxlmono) or PCL 5e 
(ljet4/ljet4d/hpcups/hpijs) options.


Or try running the command

driverless

If it lists a URI (Unified Resource Identifier) for your printer 
(contains your printers host name, IP, or make/model), try to set up 
your printer with


lpadmin -p Printers -E -v URI -m everywhere

replacing URI by your printer's URI from the "driverless" output.

Does this work?

   Till



Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Yves-Alexis Perez
On Wed, 2020-02-05 at 17:19 +, Brian Potkin wrote:
> > Not really sure, but I don't think so. I mean, I'm using the PPD file
> > from cups Debian packages, not anything from Brother.
> 
> As root, what do you get for
> 
>  grep "*NickName" /etc/cups/ppd/

*NickName: "Brother HL-5250DN BR-Script3"

The ppd is Copyright(C) 2005 Brother Industries, Ltd. so even if I have it
from Debian, it still comes from Brother.
> 
> Do you know the package name?

Not really, but I's the one cups (either the web interface or system-config-
printer) shows me when using make & model.
> 
> > > I did test how filtering went with it
> > > and a file or two. I got no errors, but did get the warnings you
> > > got. Then again, I do not have the printer to print the output
> > > file to.
> > 
> > Not entirely sure what is your workflow here, but with some details
> > maybe I can try to reproduce what you did and see if something goes out
> > of the printer?
> 
> Later, certainly. I'd like to test with your PPD first.

Attached.
> 
> Open a new issue referring to #169 and referencing the Debian report.
I saw your other mail so I'm postponing that. I'll also check the steps from
Till

Regards,
--
Yves-Alexis
*PPD-Adobe: "4.3"
*% This program is free software; you can redistribute it and/or modify it
*% under the terms of the GNU General Public License as published by the Free
*% Software Foundation; either version 2 of the License, or (at your option)
*% any later version.
*%
*% This program is distributed in the hope that it will be useful, but WITHOUT
*% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
*% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
*% more details.
*%
*% You should have received a copy of the GNU General Public License along with
*% this program; if not, write to the Free Software Foundation, Inc., 59 Temple
*% Place, Suite 330, Boston, MA  02111-1307  USA
*%


*%
*%  Copyright(C) 2005 Brother Industries, Ltd.
*%  "Brother HL-5250DN BR-Script3"
*%

*% General Information Keywords 
*FormatVersion: "4.3"
*FileVersion: "1.03"
*LanguageEncoding: ISOLatin1
*LanguageVersion: English
*Manufacturer: "Brother"
*PCFileName: "BR5250_2.PPD"
*Product: "(Brother HL-5250DN series)"
*PSVersion: "(3010.106) 5"
*ShortNickName: "Brother HL-5250DN BR-Script3"
*ModelName: "Brother HL-5250DN BR-Script3"
*NickName: "Brother HL-5250DN BR-Script3"
*1284DeviceID: "MFG:Brother;MDL:HL-5250DN series;CMD:PJL,PCL,PCLXL,POSTSCRIPT;"

*% Basic Device Capabilities =
*LanguageLevel: "3"
*TTRasterizer: Type42
*ColorDevice: False
*DefaultColorSpace: Gray
*FileSystem: True
*?FileSystem:"
save 
/devname (%disk0%) def 
/ret false def 
0 1 7{ 
devname exch 48 add 5 exch put 
devname devstatus { 
0 ne {/ret true def}if 
pop pop pop pop pop pop pop 
}if 
}for 
ret {(True)}{(False)} ifelse = flush 
restore 
" 
*End

*Throughput: "28"
*FreeVM: "605"

*% Emulations and Protocols ==
*Protocols: PJL TBCP

*SuggestedJobTimeout: "0"
*SuggestedWaitTimeout: "300"
*PrintPSErrors: True

*% PostScript Patches ==
*%*JobPatchFile 1: "statusdict/setusbbinary known{statusdict begin true 
setusbbinary end}if"

*% JCL Features ==
*JCLBegin:   "<1B>%-12345X@PJL JOB<0A>"
*JCLToPSInterpreter: "@PJL ENTER LANGUAGE = POSTSCRIPT <0A>"
*JCLEnd: "<1B>%-12345X@PJL EOJ <0A><1B>%-12345X"

*% Installable Options ===

*OpenGroup: InstallableOptions/Options Installed

*OpenUI *OptionTrays/Number of Input Trays: PickOne
*DefaultOptionTrays: 1Trays
*OptionTrays 1Trays/ 1: ""
*OptionTrays 2Trays/ 2: ""
*OptionTrays 3Trays/ 3: ""
*?OptionTrays:"
save
<>setpagedevice currentpagedevice/BRFeeder get
2 eq{(3Trays)}{
  <>setpagedevice currentpagedevice/BRFeeder get
  1 eq{(2Trays)}{(1Trays)}ifelse
}ifelse
  = flush 
restore 
"
*End
*CloseUI: *OptionTrays

*CloseGroup: InstallableOptions

*UIConstraints: *OptionTrays 1Trays *InputSlot Tray2
*UIConstraints: *InputSlot Tray2 *OptionTrays 1Trays
*UIConstraints: *OptionTrays 1Trays *InputSlot Tray3
*UIConstraints: *InputSlot Tray3 *OptionTrays 1Trays
*UIConstraints: *OptionTrays 2Trays *InputSlot Tray3
*UIConstraints: *InputSlot Tray3 *OptionTrays 2Trays



*% Media Selection ==

*OpenUI *PageSize: PickOne
*OrderDependency: 30 AnySetup *PageSize
*DefaultPageSize: A4
*PageSize Letter/Letter: "<< /PageSize [612 792] /ImagingBBox null >> 
setpagedevice"
*PageSize Legal/Legal: "<< /PageSize [612 1008] /ImagingBBox null >> 
setpagedevice"
*PageSize Executive/Executive: "<< /PageSize [522 756] /ImagingBBox null >> 
setpagedevice"
*PageSize A4/A4: "<< /PageSize [595 842] /ImagingBBox null

Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Yves-Alexis Perez
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On Wed, 2020-02-05 at 19:32 +0100, Till Kamppeter wrote:
> Probably the best is to try to print without using PostScript. When 
> creating a print queue and selecting your printer's make, model, and 
> driver manually, have a look at PCL 6/XL (pxlmono) or PCL 5e 
> (ljet4/ljet4d/hpcups/hpijs) options.

So, I'm even more confused. I've upgraded again cups-filters (to 1.27.0-2) in
order to do a comparison check, and tried to print, and it did work (with the
Brother PPD, unchanged).
> 
> Or try running the command
> 
> driverless

This doesn't return anything. My printer is on the network but I don't think
it advertises itself using Bonjour/zeroconf, so I'm unsure if it'd be enough
for that to find it.
- -- 
Yves-Alexis
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEE8vi34Qgfo83x35gF3rYcyPpXRFsFAl47FBMACgkQ3rYcyPpX
RFtdsAf8D6wygO1CWSEe/xm1ZS5EkItg8zU4w69VvGmx/oeGAhd1KszecD2NwCkn
1SauiLt/POdnpCHCaiFpgzkHqmsXEW4IMg6rUxSawkLUnEgSeRW+UQT052VlNCWY
S9WvJxzoDDDQWjIUAX0oGy6fSDc9J61092S+TEBKwREtqifo2SdsBJ1DK0O9lOZp
LGY8RAdrJgL/XoIZnh30yJMTXqTG3KTuUMolTWBQeqQ0QR0VcQxhPVFZijcO8+5S
5PU8njwahwPXU7taZDCVcOtekboxMU8vSNJf9Gk7gkOxFEioMdSqaCLWCb3UGZyv
u83o2BbBxdtgY6g/BzRJCbh/39J2wA==
=wKgw
-END PGP SIGNATURE-



Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Brian Potkin
On Wed 05 Feb 2020 at 20:05:27 +0100, Yves-Alexis Perez wrote:

> On Wed, 2020-02-05 at 17:19 +, Brian Potkin wrote:
> > > Not really sure, but I don't think so. I mean, I'm using the PPD file
> > > from cups Debian packages, not anything from Brother.
> > 
> > As root, what do you get for
> > 
> >  grep "*NickName" /etc/cups/ppd/
> 
> *NickName: "Brother HL-5250DN BR-Script3"
> 
> The ppd is Copyright(C) 2005 Brother Industries, Ltd. so even if I have it
> from Debian, it still comes from Brother.

It is basically the same as the one I have from Brother.

> > Do you know the package name?
> 
> Not really, but I's the one cups (either the web interface or system-config-
> printer) shows me when using make & model.

We'll let that go. It is something for me to sort out.

> > > > I did test how filtering went with it
> > > > and a file or two. I got no errors, but did get the warnings you
> > > > got. Then again, I do not have the printer to print the output
> > > > file to.
> > > 
> > > Not entirely sure what is your workflow here, but with some details
> > > maybe I can try to reproduce what you did and see if something goes out
> > > of the printer?
> > 
> > Later, certainly. I'd like to test with your PPD first.
> 
> Attached.

Thanks. I used it (as root) with

 cupsfilter -p /etc/cups/ppd/ -m printer/foo -e /etc/nsswitch > out.ps 
2>log

There aren't any errors in the log.

Regards,

Brian.



Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Till Kamppeter

I have tried it also and with the command line

cupsfilter -p ../HL5250DN.ppd -i text/plain -m 
application/vnd.cups-postscript -e ~/.bashrc > out.ps 2>log


I got valid PostScript output with a PJL header. Note that I had to 
specify both input and output MIME types.


Probably in the cases whenthe printer does not print CUPS sends valid 
PJL and PostScript but some PostScript interpreter bug in the printer 
prevents it from printing.


You can try to send the PostScript output of the command line above to 
your printer without further filtering, either do


lp -d  -o raw out.ps

or

nc -w1  9100 < out.ps

Please try.

   Till



Bug#950690: cups-filters: Printing fails with an error about Grayscale/monochrome conversion

2020-02-05 Thread Till Kamppeter

On 05/02/2020 20:14, Yves-Alexis Perez wrote:

So, I'm even more confused. I've upgraded again cups-filters (to 1.27.0-2) in
order to do a comparison check, and tried to print, and it did work (with the
Brother PPD, unchanged).


This looks strange, there is no change in the pdftops filter which could 
have changed something before the last release.




Or try running the command

driverless


This doesn't return anything. My printer is on the network but I don't think
it advertises itself using Bonjour/zeroconf, so I'm unsure if it'd be enough
for that to find it.


driverless printing is a rather new property in network printers. It 
started some years ago with AirPrint to make iPhones be able to print 
when connecting to the local network via the WLAN of the router. 
Generally printers advertised to print from phones support at least one 
form of driverless printing, AirPrint in most cases. Typically the 
network printers launched in the last 5 years do driverless but your 
printer can be older.


"driverless" lists all IPP printers which support driverless printing.

   Till