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

commandline PDF printing

276 views
Skip to first unread message

VUK

unread,
Jan 10, 2003, 7:17:14 AM1/10/03
to
Is there a way to print a PDF document to a printer in command line?
Suppose acrobat reader is installed but KDE (X) is not running?

is there a command like:

printpdf sample.pdf -Prlmip0 , where rlmip0 is a printer defined in /etc/printcap ?
post answer here
Thanks
VUK

mps

unread,
Jan 10, 2003, 8:21:04 AM1/10/03
to
VUK wrote:

What printing package are you using? CUPS has built in PDF
processing support so that lp -d yourprinter sample.pdf or lpr
-P yourprinter sample.pdf will work. LPRng has file recognition
support so that you have to hack the filter config file to point
it to a program that will convert your pdf to a printer-friendly
file.

Joseph Szadai

unread,
Jan 10, 2003, 10:29:38 AM1/10/03
to
I am using ted. I have an RTF file which I can convert
to postsript. However the printer I have does nor �[3~�[3~�[3~
does not understand postscript, so I am using rtf2pdf which
converts RTF to PDF using ted. And I e want this PDF to print
to the printer using commandline program.
Joe
###�

kw...@digitalhermit.com

unread,
Jan 10, 2003, 11:26:04 AM1/10/03
to
On Fri, 10 Jan 2003, Joseph Szadai wrote:

> I am using ted. I have an RTF file which I can convert to

> postsript. However the printer I have does not understand postscript,
> so I am using rtf2pdf which converts RTF to PDF using ted. And I want


> this PDF to print to the printer using commandline program.

Have you tried:
lpr filename.pdf

The filters generally do a good job of determining the filetype and then
automagically using the right filters.

Dave Brown

unread,
Jan 10, 2003, 10:03:23 AM1/10/03
to
In article <4NzT9.40343$xb....@nwrddc02.gnilink.net>, mps wrote:
> VUK wrote:
>> Is there a way to print a PDF document to a printer in command
>> line? Suppose acrobat reader is installed but KDE (X) is not
>> running?
>>
>> is there a command like:
>>
>> printpdf sample.pdf -Prlmip0 , where rlmip0 is a printer
>> defined in /etc/printcap ? post answer here
>
> What printing package are you using? CUPS has built in PDF
> processing support so that lp -d yourprinter sample.pdf or lpr
> -P yourprinter sample.pdf will work. LPRng has file recognition
> support so that you have to hack the filter config file to point
> it to a program that will convert your pdf to a printer-friendly
> file.

Eg.: pdf2ps sample.pdf - | lpr

You could make this a shell function:
lprpdf () {
pdf2ps $1 - | lpr
}
in your ~/.bashrc, so then you'd type:
lprpdf sample.pdf

--
Dave Brown Austin, TX

Bob Tennent

unread,
Jan 10, 2003, 12:18:40 PM1/10/03
to

You're going the wrong way. If you've configured your printer properly,
you should be able to print a Postscript file from the editor or from
the command line using just lpr. Don't waste your time with pdf unless
you want to distribute the document to other people. What distro are you
using and how did you configure your printer?

Joseph Szadai

unread,
Jan 10, 2003, 2:39:35 PM1/10/03
to
Hello
My problem is that the printer does not understand postscript.
I have rtf2ps and it works on a postscript printer but not on
a HP laserjet 1100 for example. That is why I guessed that
PDF would be the solution if a program like acrobat read prints
it. Problem is that X must be run for acrobat reader and also
you have to click file/print to print the loaded document
what I need is a command which do the same with a given file
like: printpdf sample.pdf
(in this case printpdf does like acrobat reader does in file/print
with the loaded doc)
Joe

Joseph Szadai

unread,
Jan 10, 2003, 2:41:48 PM1/10/03
to
Hi
on the server I tested running suse 8.1
I called HP technical service and I was told that HP Laserjet 1100
(the printer in question) does NOT support postscript, so if
I have a .ps file it will not appear on the printer correctly.
and I tried and it does not appear correctly.only garbagge comes out
from the laserjet 1100.

Grant Edwards

unread,
Jan 10, 2003, 3:08:17 PM1/10/03
to
In article <avn7hn$11$1...@freenet9.carleton.ca>, Joseph Szadai wrote:
> Hello
> My problem is that the printer does not understand postscript.
> I have rtf2ps and it works on a postscript printer but not on
> a HP laserjet 1100 for example. That is why I guessed that
> PDF would be the solution if a program like acrobat read prints
> it.

Acrobat reader will generate postscript when you tell it to
print. In order for your printer to be useful under Linux,
you're going to have to get it set up so you can print
Postscript.

--
Grant Edwards grante Yow! Clear the
at laundromat!! This
visi.com whirl-o-matic just had a
nuclear meltdown!!

Grant Edwards

unread,
Jan 10, 2003, 3:08:47 PM1/10/03
to

Then that's the first problem you need to solve: you need to be
able to print postscript.

--
Grant Edwards grante Yow! Hmmm... a CRIPPLED
at ACCOUNTANT with a FALAFEL
visi.com sandwich is HIT by a
TROLLEY-CAR...

Carl Fink

unread,
Jan 10, 2003, 3:28:28 PM1/10/03
to
In article <avn7ls$5q$1...@freenet9.carleton.ca>, Joseph Szadai wrote:

> on the server I tested running suse 8.1
> I called HP technical service and I was told that HP Laserjet 1100

> (the printer in question) does NOT support postscript ...

That doesn't matter. My Epson inkjet doesn't directly print
PostScript either, and I still print .ps files. You can install
GhostScript and Magicfilter, and the system will then automatically
convert PostScript to PCL (the language the LaserJet does
understand). Install those two packages and run "magicfilterconfig"
and you should be fine.
--
Carl Fink ca...@dm.net
Manager, Dueling Modems Computer Forum
<http://dm.net>

Chris F.A. Johnson

unread,
Jan 10, 2003, 3:36:53 PM1/10/03
to
On Fri, 10 Jan 2003 at 20:08 GMT, Grant Edwards wrote:
> In article <avn7ls$5q$1...@freenet9.carleton.ca>, Joseph Szadai wrote:
>
>> on the server I tested running suse 8.1
>> I called HP technical service and I was told that HP Laserjet 1100
>> (the printer in question) does NOT support postscript, so if
>> I have a .ps file it will not appear on the printer correctly.
>> and I tried and it does not appear correctly.only garbagge comes out
>> from the laserjet 1100.
>
> Then that's the first problem you need to solve: you need to be
> able to print postscript.

Interestingly, I can print PDF files, but not PostScript! I'm using
CUPS to print to a Samsung ML1210 on a Win98 box.

I haven't bothered hunting for the problem; I just convert to pdf.

--
Chris F.A. Johnson http://cfaj.freeshell.org
===================================================================
My code (if any) in this post is copyright 2002, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License

Dave Brown

unread,
Jan 10, 2003, 3:13:21 PM1/10/03
to
In article <avn7ls$5q$1...@freenet9.carleton.ca>, Joseph Szadai wrote:

There are a lot of printers around that "do not support postscript"
that are happily printing postscript files with the appropriate
intervening software. That intervening software, called Ghostscript,
translates a postscript document into a bitmap for ordinary printers.

Surely SuSE has a printer setup tool that has a HP laserjet 1100
listed on it. If not, try setting it up for "lj4", i.e., as if it
was a laserjet 4.

Lee Sau Dan

unread,
Jan 13, 2003, 3:44:00 AM1/13/03
to
>>>>> "VUK" == VUK <vuk...@usa.net> writes:

VUK> printpdf sample.pdf -Prlmip0 , where rlmip0 is a printer
VUK> defined in /etc/printcap ? post answer here Thanks VUK

case I: You're using a Postscript printer. Then, your problem is
reduced to the problem of converting PDF to PS. There are a few
possibilities. I'm not sure if those "user-too-friendly" programs
like Adobe's PDF reader would like to work without X. But there is
'pdftops' (which comes with 'xpdf') and 'pdf2ps' (which comes with
ghostscript). Note all PDF files are nice enough to work with these,
but most do.

case II: You're not using a Postscript printer. Since you're using
unix, you should have already set up the system so that you can print
Postscript (typically using ghostscript as a print filter). So, you
this reduces to case I ;). However, if you're already using
ghostscript, then the good news is that ghostscript also understands
PDF (to a certain extent). You could try to give it your PDF file
directly (without first converting to PS) as input and see if it
generates the printout correctly.


--
Lee Sau Dan 李守敦(Big5) ~{@nJX6X~}(HZ)

E-mail: dan...@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

0 new messages