2

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.
3
  • docs.xfce.org/xfce/thunar/custom-actions
    – s3lph
    Nov 10, 2014 at 13:46
  • @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, 2014 at 13:58
  • @the_Seppi - question updated
    – user47206
    Nov 10, 2014 at 14:22

1 Answer 1

4

Test this:

Converting PDF to PNGs

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

You must log in to answer this question.