Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Print to a (postscript) file

2 views
Skip to first unread message

Cecil Westerhof

unread,
Nov 13, 2009, 3:42:06 AM11/13/09
to
Is there a way to let lp not send its output to the printer, but to a
file? Or is there another way to print a document to a file?

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Manuel B.

unread,
Nov 13, 2009, 5:57:19 AM11/13/09
to
Cecil Westerhof wrote:
> Is there a way to let lp not send its output to the printer, but to a
> file? Or is there another way to print a document to a file?
>
I don't know how make a ps with lp (perhaps adding a virtual printer
with output to file?).
There is however a tool from psutils named a2ps, it has a syntax like
a2ps -o file.ps inputfile

--
M.B.

Cecil Westerhof

unread,
Nov 13, 2009, 6:44:03 AM11/13/09
to
"Manuel B." <manuel@#cuthere#geckoslair.net> writes:

>> Is there a way to let lp not send its output to the printer, but to a
>> file? Or is there another way to print a document to a file?
>>
> I don't know how make a ps with lp (perhaps adding a virtual printer
> with output to file?).

Is there a simple way to do this? I need this for a script, so the users
of the script need to add is also. And when it is difficult ...


> There is however a tool from psutils named a2ps, it has a syntax like
> a2ps -o file.ps inputfile

I already tried that. But that did not work. It is a doc-file of four
pages, but a2ps thinks it is 696 pages. And it ends with the message
(translated from Dutch):
is binary, aborted

Unruh

unread,
Nov 13, 2009, 11:43:32 AM11/13/09
to
Cecil Westerhof <Ce...@decebal.nl> writes:

>Is there a way to let lp not send its output to the printer, but to a
>file? Or is there another way to print a document to a file?

Most programs already have a "print to file" option. The problem with trying to it
via lp is that lp has no option to ask you for a filename, unless you want it to
print it always to the same filename. Most programs are however two way, and can
ask you for the filename.

If you are desperate, you could print the document to a printer which is switched
off (eg defining a postscript printer which is not attached to your computer) and
then grabbing the file from the /var/spool/cups/d* files and then cancelling the
job so the spool does not fill up.

Unruh

unread,
Nov 13, 2009, 11:44:47 AM11/13/09
to
Cecil Westerhof <Ce...@decebal.nl> writes:

>"Manuel B." <manuel@#cuthere#geckoslair.net> writes:

>>> Is there a way to let lp not send its output to the printer, but to a
>>> file? Or is there another way to print a document to a file?
>>>
>> I don't know how make a ps with lp (perhaps adding a virtual printer
>> with output to file?).

>Is there a simple way to do this? I need this for a script, so the users
>of the script need to add is also. And when it is difficult ...


>> There is however a tool from psutils named a2ps, it has a syntax like
>> a2ps -o file.ps inputfile

>I already tried that. But that did not work. It is a doc-file of four
>pages, but a2ps thinks it is 696 pages. And it ends with the message
>(translated from Dutch):
> is binary, aborted

open the doc file with openoffice, and print to file. (openoffice has that
option).

Cecil Westerhof

unread,
Nov 13, 2009, 12:27:22 PM11/13/09
to
Unruh <unruh...@physics.ubc.ca> writes:

> If you are desperate, you could print the document to a printer which is switched
> off (eg defining a postscript printer which is not attached to your computer) and
> then grabbing the file from the /var/spool/cups/d* files and then cancelling the
> job so the spool does not fill up.

I was thinking about that, but instead working wit '-H hold', but the
problem is bigger. When trying to print (with and without '-H hold') I
get:
lp: Unsupported format 'application/octet-stream'!

There is also the problem that /var/spool/cups is only readable by root,
but that could be solved I think.

0 new messages