I just added a right-click menu option that allows you to select multiple files, select Script/pdf-printer.sh and it'll create PDF files. If you choose another printer name in the script, it should use that instead, but I can't verify that. Older howtos might not work because we've moved to Gnome 3 which has a few changes. In this case, scripts have been moved from ~/.gnome2/nautilus-scripts to ~/.local/share/nautilus/scripts. Otherwise, everything should work as you would expect.
- Install http://apt.ubuntu.com/p/cups-pdf. This package provides a PDF printer which prints to the PDF folder in your home folder, $HOME/PDF.
- Open Nautilus and create a folder named PDF in your home.
- Press Ctrl+H in Nautilus to show hidden files.
- Open ~/.local/share/nautilus/scripts.
- Create a new file and call it "pdf-printer.sh".
- Paste the following:
#!/bin/bash # # pdf-printer.sh # # Print files from the right-click context menu in Nautilus. # Place this script in ~/.local/share/nautilus/scripts. # The printer to use (as shown in the Printer Configuration # gui or in /etc/cups/printers.conf). printer=PDF echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | while read file do lpr -P "$printer" "$file" done exit 0
- Save the file and close it.
- Right-click the file and choose Properties > Permissions. Make sure the box is checked to allow executing the file.
It is possible that you have to restart nautilus for this to work. In that case, you can press Alt+F2 and enter
killall nautilus. Other than that, you should now be able to select files, right click and use the script from the "script" menu.