LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-13-2009, 02:16 AM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
How to print a PDF without xorg/x11 using console?


Hello,

There is a printer on a distant server, and I have quite some lot of pdf to print. Is there any ways to print a PDF without X11?

Usually I print with evince, rather than acroread ; but in this case, no X.

thanks
Greetings to Debian, the best distro on earth
 
Old 12-13-2009, 04:05 AM   #2
rikijpn
Member
 
Registered: Jun 2007
Location: Japan
Distribution: Debian lenny, DSL, Solaris 10
Posts: 157

Rep: Reputation: 33
no need for X while u have the shell

Code:
pdf2ps
try the man page first.
You can do something like pdf2ps somefile.pdf|lpr -P printer_name
or just print it to post script files like pdf2ps file.pdf file.ps, etc.
 
Old 12-13-2009, 04:19 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Do you know how the printer is configured on the remote system, what the queue name is and if it's accepting jobs from the internet/external source? If so you could set up CUPS with the config files in /etc/cups, create the printer (ipp or http) and print directly to the queue using:
Code:
lp -d <document> <queuename>
Even without CUPS it should be possible with lp using the -h parameter:
Code:
lp -h hostname:port -d <documentname>
That is of course if the printer/server on the other side is accepting print jobs.

Kind regards,

Eric
 
Old 12-13-2009, 04:19 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
.

lp file.pdf
 
Old 12-13-2009, 07:10 AM   #5
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by EricTRA View Post
Hi,

Do you know how the printer is configured on the remote system, what the queue name is and if it's accepting jobs from the internet/external source? If so you could set up CUPS with the config files in /etc/cups, create the printer (ipp or http) and print directly to the queue using:
Code:
lp -d <document> <queuename>
Even without CUPS it should be possible with lp using the -h parameter:
Code:
lp -h hostname:port -d <documentname>
That is of course if the printer/server on the other side is accepting print jobs.

Kind regards,

Eric
thank you Eric. A question, the printer is USB, and I would like to install it and share it for linux boxes. Any idea how to do that without KDE or any X11 installed (server). I installed printconf and it seems that printconf (usb print manager) is compatible with it.


I found this howto but http://www.linuxquestions.org/linux/...ter_using_CUPS

but my printer is an USB and has no IP number (network cable).

Last edited by frenchn00b; 12-13-2009 at 07:12 AM.
 
Old 12-13-2009, 07:28 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

The easiest way is to have it configured and shared with CUPS in my opinion. You can either do all configuration using the configuration files of CUPS (/etc/cups/) or use the web interface. I know you said you don't have a GUI but if you have lynx installed it works as well. Basically you install your usb connected printer under CUPS, configure CUPS to share the connected printer and connect from the other boxes using lp. If you have CUPS installed on the other boxes the shared printer will be instantly available on those boxes too, with the same queue name.

I have my USB printer connected to my laptop, share it and can print from another linux laptop to that printer without any problems.

Kind regards,

Eric
 
Old 12-13-2009, 08:13 AM   #7
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
wow it worked, for the moment

Code:
apt-get install printconf cups lynx
wait installation

get the PPD file here
http://www.linuxprinting.org/

then go into :
as user
lynx localhost:631
Quote:
This will start the cups server. Next, you'll need to add a printer by using the web interface. To do this, open a web browser and type in localhost:631. If your server is started, a page should load with links to various tasks. Click the first link Do Administration Tasks. A dialog will pop up asking for username and password. You need to log in as root and use your root password to access the administration menu.
Once logged in, click add printers and follow the prompts to set up your printer. When the printer is added, click on the "Configure Printer" to set page size and printing quality. Finally, click "Print Test Page". If a test page prints, you're almost ready to go on to Step 2.
and finally active it as server
[X] Share published printers connected to this
I have made change in cupsd.conf
as
i
Code:
 [X] Share published printers connected to this  # Show troubleshooting information in error_log.
LogLevel debug
SystemGroup lpadmin
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseAddress @LOCAL
DefaultAuthType Basic
<Location />
  AuthType None
  Deny From None
  Allow From All
  # Allow shared printing...
  Order allow,deny
  Allow @LOCAL
</Location>
<Location /admin>
  # Restrict access to the admin pages...
  Order allow,deny
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  # Restrict access to the configuration files...
  Order allow,deny
</Location>
Code:
Administration

     Home       Administration       Classes       Documentation/Help       Jobs       Printers

   Printers

      Add Printer Find New Printers Manage Printers

   Classes

      Add Class Manage Classes

   Jobs

      Manage Jobs


                                                             Server

                                                                Edit Configuration File View Access Log View Error Log View Page Log

                                                                Basic Server Settings:

                                                                [X] Show printers shared by other systems
                                                                [X] Share published printers connected to this system
                                                                         [ ] Allow printing from the Internet
                                                                [ ] Allow remote administration
(NORMAL LINK) Use right-arrow or <return> to activate.
  Arrow keys: Up and Down to move.  Right to follow a link; Left to go back.
 H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list
now seeking
 
Old 12-13-2009, 08:16 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Looking good!!! Also if you make CUPS listen on a network IP, you can administer the whole thing from another computer that has GUI, if you feel more at ease with that.

Kind regards,

Eric
 
Old 12-13-2009, 08:20 AM   #9
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
I could print using kdeprinter configurator. Lets try to make it purely command line, client side.
print server works now, or almost using cups.(I tested used another client with gui)


The client side without X11:

I get an error


Code:
 lp -h 10.1.1.10:631 -d test.txt
lp: The printer or class was not found.
nmap 10.1.1.10
Code:
PORT     STATE SERVICE
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
544/tcp  open  kshell
631/tcp  open  ipp
10.1.1.10:631 is the printer server

Last edited by frenchn00b; 12-13-2009 at 08:24 AM.
 
Old 12-13-2009, 08:24 AM   #10
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Where are you stating the queue name? (lp -h <host : port> -d <document> <queuename>)
Type
Code:
lpstat -a
to check if you can see the printerqueue and the status of it.

Kind regards,

Eric
 
Old 12-13-2009, 08:34 AM   #11
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by EricTRA View Post
Hello,

Where are you stating the queue name? (lp -h <host : port> -d <document> <queuename>)
Type
Code:
lpstat -a
to check if you can see the printerqueue and the status of it.

Kind regards,

Eric
seems that I got something, from the pc that has used kdeprinting
Code:
$ lpstat -a
Lexmark-Lexmark-Z55 accepting requests since
i will try on another one.

So the next step to print or to add this printer without X to the user printing configuration, shoudl be possible?
 
Old 12-13-2009, 08:44 AM   #12
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
~$ export PRINTER=Lexmark-Lexmark-Z55 ; lp text.txt
request id is (1 file(s))
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

Last edited by frenchn00b; 12-13-2009 at 08:53 AM.
 
Old 12-13-2009, 08:53 AM   #13
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

I don't know exactly how you configure a printer, commandline only for a user to set it as default. I'd have to look it up. If the queue is available to them then they can print, but how to set that up as default per user basis is unclear to me.

Kind regards,

Eric
 
Old 12-13-2009, 08:56 AM   #14
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Just got this from the CUPS user manual.

Quote:
Setting the Default Printer

The administrator normally will set a system-wide default printer that is normally used as the default printer by everyone. Use the -d printer option to set your own default printer:

lpoptions -d deskjet ENTER

The printer can be local (deskjet) or remote ( deskjet@server).
Would this be sufficient?

Kind regards,

Eric
 
Old 12-13-2009, 08:56 AM   #15
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by EricTRA View Post
Hi,

I don't know exactly how you configure a printer, commandline only for a user to set it as default. I'd have to look it up. If the queue is available to them then they can print, but how to set that up as default per user basis is unclear to me.

Kind regards,

Eric
for default I know:
normally you have to add the export PRINTER=LEXMARK

PRINTER can be set in .bashrc

lpstat -v gives all the possible printers.

but well, I know that, can print with evince/acroread, but it cannot from command line for no idea which reason.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Error with xorg-x11-server-Xorg callumacrae Fedora 1 10-13-2009 02:22 PM
How to print a message from kernel module to terminal console or tty console yogesh_bansal Linux - Newbie 2 02-27-2009 09:10 AM
xorg-x11-devel dependant on old version of xorg-x11-libs thetawaverider Linux - Software 1 11-09-2006 07:22 AM
Print-to-file print driver to print PDF Bill Fox Linux - General 3 05-02-2006 04:15 PM
xorg-x11-libs required by xorg-x11-devel darknails Fedora 1 01-13-2005 02:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration