Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently I open the file in document viewer and select print etc. Is it not possible to right click the file and "send to" the printer?

share|improve this question
What Ubuntu release are you using? – Mitch Jul 31 '12 at 6:53
Ubuntu 12.04..... – HeyPaul Jul 31 '12 at 11:03

Use lpr to print PDF files directly from the command-line

I don't think you can do that directly, no. However, there's a command line program called lpr which sends pdf files directly to the printer. So if you have doc.pdf, you should be able to print it with lpr doc.pdf (assuming you're in the right folder on the command line).

You can also view the printer queue with lpq - besides the queue, this shows which is the default printer, and what its status is...

See the other answer for how to add lpr to the right-click menu.

share|improve this answer
Thank you I should have remembered lpr from ages ago. – HeyPaul Jul 31 '12 at 8:17

Add lpr to the right-click menu

I didn't know about 'lpr' that Steve mentioned about, but I know how to add it to your right click menu, using the Nautilus Scripts function of Nautilus.

Just copy and paste the below text to Gedit:



   if [[ "$line" = "" || "$line" = " " ]]; then
   lpr "$line"
   sleep 1;


Save the file as 'Send to Printer' and then, right click on it->Properties->Permissions->Tick "Allow executing file as program"

Finally, move the file under ~/.gnome2/nautilus-scripts

Now, in every .pdf file you want, you can right click on it and choose Scripts->'Send to Printer'. The command 'lpr' that Steve mentioned about will execute to the file you have selected.

share|improve this answer
Thank you - that works perfectly. – HeyPaul Jul 31 '12 at 8:17
Aaaargh - it doesn't work from windows shares! I print orders from a win98 program to pdf files. Then in ubuntu I print to paper. – HeyPaul Jul 31 '12 at 8:33
Hm, that sounds logical, you should have mentioned that you wanted to work through windows shares, though :/ I don't know how nautilus scripts work through windows shares.... I will test it and post back. EDIT: I cannot currently test it but you could first download the pdfs from the network to your hard disk and then use the script... – hakermania Jul 31 '12 at 8:35
Yes - but then I might as well just open them directly and print them!! – HeyPaul Jul 31 '12 at 9:00
No, it is not the same. The failure is logical: The files are not in your PC, you can only see their filenames, how can your PC send them for printing? You can download all of them, select all of them and choose right-click->'Send to Printer' – hakermania Jul 31 '12 at 9:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.