LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How to print a PDF without xorg/x11 using console? (https://www.linuxquestions.org/questions/debian-26/how-to-print-a-pdf-without-xorg-x11-using-console-775285/)

EricTRA 12-13-2009 08:58 AM

Quote:

Originally Posted by frenchn00b (Post 3789699)
but nothing come out


I tried with :
lp -PLexmark-Lexmark-Z55 text.txt

but nothing come out

I played with lprm to delete the evn. bugigng pages. but nothing ...


howto:
https://kb.iu.edu/data/adzr.html

Try:
Code:

lp -d test.txt Lexmark-Lexmark-Z55
Kind regards,

Eric

EricTRA 12-13-2009 08:59 AM

To remove jobs from the queue you could also use the web interface of CUPS, very handy.

frenchn00b 12-13-2009 09:07 AM

Hurra !! It works !
Code:

$ lp -d LEXMARK text.txt
request id is LEXMARK-12 (1 file(s))

But I had to add to cups the printer using kprinter on the client.
But I could do it with lynx localhost:631 certainly

So, now, the most difficult is done.
Any idea how to print a pdf from the command line?
it will print ascii chars of the pdf, non concerted

I know that cups can print PS format, but well, in that case


thanks a lot Eric

frenchn00b 12-13-2009 09:12 AM

it seems that the ultimate solution is :

Code:

pdf2ps somefile.pdf | lpr -P LEXMARK
Ill be back

EricTRA 12-13-2009 09:13 AM

Double post, sorry, network glitches here in Spain :d

EricTRA 12-13-2009 09:14 AM

Hi,

If CUPS is handling the printing then you should be able to directly print PDF files from the command line as far as I know. I've printed PDF from commandline to CUPS printing queue on remote server at the office and it works perfectly. No need for other tools. Also according to the CUPS documentation it should print at once.
Quote:

Printing Files

CUPS understands many different types of files directly, including text, PostScript, PDF, and image files. This allows you to print from inside your applications or at the command-line, whichever is most convenient! Type either of the following commands to print a file to the default (or only) printer on the system:

lp filename
lpr filename
And you're most welcome.

Kind regards,

Eric

frenchn00b 12-13-2009 09:21 AM

Quote:

Originally Posted by EricTRA (Post 3789735)
Hi,

If CUPS is handling the printing then you should be able to directly print PDF files from the command line as far as I know. I've printed PDF from commandline to CUPS printing queue on remote server at the office and it works perfectly. No need for other tools. Also according to the CUPS documentation it should print at once.


And you're most welcome.

Kind regards,

Eric

ok here we try:

here we go let's try:
Code:

~$ lp -d LEXMARK linuxquestions.pdf
request id is LEXMARK-13 (1 file(s))

I cant believe my eyes !!
You are a genious. It works completely. I got my page printed, like it should.

I thank you so much. I learned a lot. export PRINTER=LEXMARK is said to make it default.

Greetings to Spain.
F.

EricTRA 12-13-2009 09:23 AM

Hahahaha, me a genious? You're funny. I'm just a guy who takes advantage of the internet :cool:

No, serious, I'm glad it works. Happy Linuxing.

Kind regards,

Eric

frenchn00b 12-13-2009 09:24 AM

commands are :

lpstat -v #to see all the printers installed
lpq -a #to see the queue for printing
lp -d MYPRINTRE document.pdf # to print it
lprm JOBID # to delete a job, seen from lpq -a


All times are GMT -5. The time now is 07:50 PM.