I like this command to convert pdf pages to png images:

pdftoppm -png *.pdf prefix

(my source is this answer)

I would like to add a command to Thunar custom actions that would convert the selected pdf's pages to separate images.

When I use the option "Open terminal here" in the folder containing the pdf, and then add the above command, it works fine.

So, what I would like is a Thunar custom action with a command that (1): opens a terminal window in that folder, AND (2): runs that command in the terminal window

If I create a custom action with the command xfce4-terminal, Appearance conditions: Directories, that will open the terminal in that folder.

If I replace the command with xfce4-terminal -e "pdftoppm -png *.pdf prefix", nothing seems to happen. To see clearer it is useful to keep that terminal window open after the command was run, but I do not know how to do that with the Xfce terminal.

Using gnome-terminal I create a profile called new1 with the setting "When command exits: Hold the terminal open" then add to custom action this command:

gnome-terminal --window-with-profile=new1 -e "pdftoppm -png *.pdf prefix"

But this gives an error;

I/O Error: Couldn't open file '*.pdf': No such file or directory.
  • @the_Seppi - would you care do provide an answer with the exact command and setting? i do not know how to make an analogy for that. the command pdftoppm -png *.pdf prefix %f does not work just like that in thunar actions, it needs to be used with a bash file maybe or something, i don't know. this depends on the program used, in this case pdftoppm. – user47206 Nov 10 '14 at 13:58
  • @the_Seppi - question updated – user47206 Nov 10 '14 at 14:22

Test this:

Converting PDF to PNGs

Name: To PNG
Command: pdftoppm %f -png %f.png
File pattern: *.pdf
Appears if selection contains: Image Files
| improve this answer | |
  • It should be Appears if selection contains: Other files. Otherwise *.pdf clashes with Image Files. – landroni Aug 17 '15 at 8:59

Your Answer

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