4

On page change, redraw, or Reload command, xpdf will reload the file it is currently displaying. Is it possible to cause xpdf to reload the file by sending a signal? Which signal?

(I am basically looking for the functionality offered by xpdf -remote ServerName -reload, except I want to apply it to an xpdf that was not launched with the -remote option.)

Norman Ramsey
  • 274
  • 2
  • 8

1 Answers1

3

I don't think you can use a signal. But Xpdf accepts synthetic events, so it's easy to programmatically type r into the window using xdotool(1). Unfortunately the xpdf window does not identify itself by its PID, but the following seems to work:

xdotool search --onlyvisible  --class Xpdf key r

If you know the name of the file that Xpdf is displaying, you can match the window's title:

xdotool --name 'Xpdf: foo.pdf' key r

There's a small risk of a false positive with another window whose title just happens to contains that string. Other window matching options may help pinpoint the right window.

Norman Ramsey
  • 274
  • 2
  • 8
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
  • Turns out xpdf doesn't post its PID, so `--pid` does not work. But ` xdotool search --onlyvisible --class Xpdf key r` works. And thanks for telling me about `xdotool`! Useful! – Norman Ramsey Feb 20 '16 at 16:01