Inkscape unable to print with cups and brother laser printer

Bug #1738090 reported by Eric Saint-Etienne
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

On ubuntu 16.04, printing from inkscape on a Brother printer fails with the following message in /var/log/cups/error_log:

[...]
D [13/Dec/2017:21:50:41 +0000] [Job 87] Can\'t use an undefined value as a subroutine reference at /usr/lib/cups/filter/brother_lpdwrapper_MFCL2700DW line 565.
[...]
D [13/Dec/2017:21:50:41 +0000] [Job 87] printer-state-message="Filter failed"
[...]

The error happens in the perl cups filter /usr/lib/cups/filter/brother_lpdwrapper_MFCL2700DW.
This perl script seem to fail because it did not get a valid value for the unit:

549 if ( $lpr_options_ref->{'-pt'} eq "CUSTOM0" ){
550
551 foreach (keys %units){
552
553 if ( $ppdcust =~ /[0-9]$_$/) {
554 logprint( 2 , "HIT $_\n");
555 $unit = $_;
556 $unitfunc = $units{$_};
557 }
558 }
559 $ssize = $ppdcust;
560 $ssize =~ s/^Custom\.//g;
561 $ssize =~ s/$unit$//g;
562
563
564 my @psiz = split (/x/,$ssize);
565 ($x , $y) = &$unitfunc ( $psiz[0] ,$psiz[1]);
566
567 return ($x , $y);
568 }

At runtime I do have $lpr_options_ref->{'-pt'} equal to "CUSTOM0", so the script enters the code block, but when looping through the keys of %units, perl can't find a matching key. That's because $unit is empty (""), whereas a human readable unit is expected. See definition of the %unit hash:
 56 %units = ( pt => \&pt2dot,
 57 mm => \&mm2dot,
 58 inch => \&inch2dot,
 59 in => \&inch2dot,
 60 cm => \&cm2dot,
 61 m => \&m2dot,
 62 ft => \&ft2dot
 63 );

I'm not sure if it's because inkscape doesn't provide a valid unit when using CUSTOM0 or if it's a bug of the brother filter (which should assume some default unit).

Printing the same SVG file from Chrome works fine.

I'm using the following package versions:
- inkscape version 0.91-7ubuntu2
- mfcl2700dwcupswrapper:i386 version 3.2.0-1 (the latest)
- mfcl2700dwlpr:i386 version 3.2.0-1 (the latest)
- cups-common version 2.1.3-4ubuntu0.3
- cups-core-drivers version 2.1.3-4ubuntu0.3
- cups-server-common version 2.1.3-4ubuntu0.3
- cups-filters version 1.8.3-2ubuntu3.1
- cups-filters-core-drivers version 1.8.3-2ubuntu3.1
- libcupsfilters1:amd64 version 1.8.3-2ubuntu3.1
- libcups2:amd64 version 2.1.3-4ubuntu0.3
- libcups2:i386 version 2.1.3-4ubuntu0.3

Thank you.

-eric

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.