[Foomatic] FoomaticRIP does not handle Macintosh line endings properly

Joe Rhodes lists at joerhodes.com
Thu Jun 10 12:39:46 PDT 2004


Also posted at Sourceforge.net as bug #970577

Postscript print jobs, created on a Macintosh (using the foomatic 
PPDs) are terminated by Carriage Returns (CR)instead of Unix Line 
Feeds (LF). When submitting these jobs to foomatic-rip for 
printing, it does not find and set the embedded postscript options 
(such as print quality, page size, etc.) correctly. As a result, you 
get the defaults from the PPD file of the Unix print system.

I've got a partial work around for now: If I run the Mac print job 
through dos2unix and convert the line endings. Foomatic-rip will 
then pick up the correct options embedded in the job and set them 
as necessary. However, there are a couple of problems with this:

1. Not all postscript print jobs survive this translation. They must 
be encoded with ASCII and not binary to work, and even then, 
there are some embedded EPS images which cannot be safely 
converted. 

2. I'm having a devil of a time getting my Mac users to all 
remember to select the "encode as ASCII" option in all their 
applications (such as Quark Xpress and Adobe Illustrator).

Another Mac administrator who is a developer for Netatalk (the 
software responsible for accepting Mac print jobs and handing 
them off to the Unix print system) found this:

Bjoern Fernhomberg (lists at fernhomberg.de) wrote:

The problem seems to be in foomatic-rip, around line 2305 "if
(($printprevpage) || ($line=<STDIN>)) {". AFAIKT the code relies 
on $line
being exactly one line of PS code. IIRC the "<STDIN>" construct 
will return
exactly one line if, and only if, the line is terminated by a Unix line
ending.
I need to take a closer look at this, but I expect this is not going to 
work
with Mac and binary PS code.



As I understand it, Mac CR are legal postscript characters. Is 
there any chance Foomatic-rip could be updated to handle them 
correctly? It would make a lot of Mac admins VERY happy. 
Unfortunately, I don't know enough perl to take this on myself.

I'm using CUPS 1.1 on RedHat Fedora Core 1 with updates. Perl is 
version 5.8.3 and foomatic-rip is 3.43.2.2. I can supply a Mac 
Postscript file as an example if necessary.

Thanks!
-Joe Rhodes
lists at joerhodes.com



More information about the Printing-foomatic mailing list