Pdf viewer that handles live updating of pdf/doesn't lock the file

SumatraPDF can be used in your current workflow. It will not place a lock on the file. It also supports synchronization between editor and pdf document.


Although there's already an answer providing a native non-blocking windows PDF reader, I followed the cygwin/xpdf approach and hacked together a small script.

It is based on xpdf's -remote option which which it is possible to reload an already opened file. So, we only need to detect when the file is changed. As there is no native inotify on windows you need to install inotify-win, which is a C# program.

My script xpdf-f seems to work fine, however you have to close both, xpdf and the the script (via Strg+C) once finished watching the PDF.

#!/bin/bash

if [[ "$1" = "" ]]; then
  echo Usage: $0 FILE
  exit 1
fi

if [[ ! -e "$1" ]]; then
  echo Error: File $1 does not exist.
  exit 2
fi

xpdf -remote filewatch "$1" &
XPDFPID=$!

while [[ -e /proc/$XPDFPID ]]; do
  inotifywait `dirname $1` | grep "MODIFY $1"
  [[ $? = 0 ]] && xpdf -remote filewatch -reload
done