How to print a PDF without xorg/x11 using console?
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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
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.
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.
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.
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.