Printing to file with CUPS.

Piotr piotrwie at gmail.erase-me.com
Fri Aug 11 03:36:45 PDT 2006


> (in cupsd.conf) and you'll have "print to file" support. Then install
> your "psfileprinter":
>
>    lpadmin -p psfileprinter -v file:/tmp/my-ps-files -E -P /path/to/PPD
>
> Create the target directory:
>
>    mkdir /tmp/my-ps-files
>
> For the PPD you'd need to use one that is meant for a PostScript
> printer. To avoid inserting too much useless printer-specific code
> into the file, use a very generic one. (The one from an old version
> of Adobe Acrobat Distiller is fine).
>
> Cheers,
> Kurt

(parts of mail <cut>)

Thanks for this hint. I already found the cupsd.conf setting that needs to be set (although it's a pity it's not covered by some howto, only you ned to look into the CUPS handbook - however... Good that such a handbook exists :)

But...

Problem #1
I've choosen a "Generic Postscript PPD" file from linuxprinting.org.
I've created printer with:
lpadmin -p psfileprinter -v file:/my-ps-files -E -P /usr/lib/cups/ppd/Generic-PostScript_Printer-Postscript.ppd
After I printed testpage to file, my ghostscript interpreter (EPS 8.15) creates following output error message after invoking:
gv /my-ps-files
(not a directory... it's a... file :) look problem #2
(identic error message is displayed with gs, but it's easier to copy'n'paste)
---------------------------------------------------------------------
root at ciuchcia:/# gs my-ps-files
ESP Ghostscript 815.00 (2005-08-11)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /configurationerror in --setpagedevice--
Additional information: [/ManualFeed false]
Operand stack:
   --dict:1/1(L)--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_pu  h   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %opar  ay_pop   1   3   %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   .runexec2   --nostrin  val--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1   3   %oparray_  op   --nostringval--   --nostringval--   --nostringval--   --dict:1/2(L)--   --nostringval--   2     dict_continue
Dictionary stack:
   --dict:1114/1686(ro)(G)--   --dict:0/20(G)--   --dict:80/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 86
ESP Ghostscript 815.00: Unrecoverable error, exit code 1
-------------------------------------------------------------------

The same happended when I used a ppd of apple laserwriter's 16/600 PPD.
(i simply created second print-to-file printer with apple's PPD file).
It also happended when I used generic ppd with ghostscript filtering to version 2 of PS with limited resolution (or extended? ;) 1200x1200 dpi) and A4 paper output.

Is it possible that there's some incompatibility between ghostscript and  PPDs??? (my knowledge is little but none how the cooperation between these all packages, and how looks the flow of the information)

Depending on combination of ppd/file to print (I used a PrintTestPage from localhost:631 admin tool) i get different line of "Current file position is XX". But when I checked the "faulty" PS files I couldn't get any common denominator of line contents responsible for the error. It was often simply a comment line of ps source. If these lines are skipped by PS preprocessor... Ugh. I got nasty problem, how to find guilty command?

Second thing...
the option file:/file-directory
seems not to work as a file-directory, but a pathname to the output file!. This file gets overwritten each time i print with the file.
If i create a directory in place of that file, I got an error message from printer that CUPS expects this to be a filename, not a directory name for files...
(cups v1.1.23)

Third thing
The created ps (although not much readable for me yet - look problem#1) has following file attribs:
-rw------ meaning it's only readable by root user.
When I change cups to "RunAsUser" (only network connections of cups in my case are via samba, or directly to windows hosted printers on my local ethernet) setting of cups, would I get these files with user permissions istead? (best situation would be when the file gets also some group permissions, to manage users access on my linux to the output'd files).

a CUPS version i have is:
1.1.23. With newer Slack I'd get it promoted to 1.2.sth.

best regards,
Piotr Wierzchowski





More information about the cups mailing list