1

Right now I'm using GThumb to print images to PDF but am looking for a short-cut.

Certainly there are console based utilities to convert files to PDF but I'm looking to do that from the graphical interface. Presumably a print-to-PDF script could be executed from the graphical interface.

Would there be a ready-made solution? Looking to avoid any configuration. Something like:

print

would be ideal.

1
  • 1
    There are several possibilities, one via mime-type and another depends on the file manager. Caja/Nautilus has a "scripts" menu on right-click.
    – Marco
    May 21 at 10:37

2 Answers 2

2

You can create a nautilus script, i.e. an executable shell script (placed in a special scripts directory) that may be invoked by selecting a file or group of files in Nautilus, and right-clicking with the mouse, to bring up a context menu. One of the options in this menu is the 'Scripts' submenu, which allows you to select a script to invoke on the selected files. The submenu 'Scripts' only appears once you have at least one script in the scripts directory.

Follow these steps (replace every occurrencies of <your_username> with your real username):

  • Create a script file: gedit /home/<your_username>/.local/share/nautilus/scripts/Print

  • Paste the following content:

#!/bin/bash

# send to default printer
lpr $*
  • Save the file

  • Give it execution rights: chmod +x /home/<your_username>/.local/share/nautilus/scripts/Print

Now, if you select one or more file, right-clicking them you should see the submenu 'Script' in your menu, and the subitem 'Print'.

If you don't see them, probably you need to logout and login, or reboot the system or restart nautilus (nautilus -q && nautilus &).

1

You can print to pdf using all GUI applications.

Select "Print to File" and it will be saved as a PDF file.

3
  • I'm not seeing that option out of the box May 23 at 4:41
  • What is the application where you don't see it?
    – Pilot6
    May 23 at 8:49
  • Yes, if I launch `GThumb' I'll see an option to print to PDF. I'm asking about printing to file from the file browser. May 27 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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