How to refresh automatically on a PDF viewer?
I am editing LaTeX on my Windows Vista systems. Which I am using pdflatex
to 开发者_运维百科generate PDF file constantly.
My PDF viewer is Adobe Acrobat Professional 7, I have to close and open the same file each time to get the new look.
Is there any way to keep the PDF viewer refreshing the PDF pages once it changed?
From a question on super user
SumatraPDF is free, for Windows, and plays nicely with LaTeX. It will automatically refresh when the pdf is updated.
It's also portable, which is nice.
The viewer does not regularly check changes on disk, so short answer: no (unfortunately)
You could however, use your browser to see the pdf file, inside your own html 'webpage' that regularly refreshes the page using javascript.
this is how (including buttons for switching between manual and automatic refreshing):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<title>my pdf</title>
<script type="text/javascript">
var timer = null;
function refresh(){
var d = document.getElementById("pdf"); // gets pdf-div
d.innerHTML = '<embed src="myPdfFile.pdf" width="700" height="575">';
}
function autoRefresh(){
timer = setTimeout("autoRefresh()", 2000);
refresh();
}
function manualRefresh(){
clearTimeout(timer);
refresh();
}
</script>
</head>
<body>
<button onclick="manualRefresh()">manual refresh</button>
<button onclick="autoRefresh()">auto refresh</button>
<div id="pdf"></div>
</body>
<script type="text/javascript">refresh();</script>
</html>
Just save this code as e.g. 'pdfrefresher.html' in the same folder as your pdf. As src
of the embed object you use only the filename, e.g. 'myPdfFile.pdf' (not disk or directory).
In the code, you can adjust the width and height of the embedded object and the timeout (in milliseconds).
Evince pdf viewer auto-refreshes.
It is an extremely light and free (GNU) pdf viewer that is the default on most linux OS. There is a Windows version also. Although, I have used evince only in linux, I am sure it has the same features in Windows.
Adobe Reader and/or Adobe Acrobat are notorious for not supporting auto-refreshing the view of a PDF which changed on disk.
If you need that, you should switch your viewer.
SumatraPDF is available for Windows and does auto-refresh the view. Should it not work at times, you can simply type 'r'
to force a refresh...
For Linux desktop systems, xreader does an excellent job in the "auto-refresh capable" category. Small number of dependencies; not heavily dependent on any particular desktop (ex: GNOME, KDE) either.
For user who are on MacOS you have LivePDFViewer that allows you live update of the view and other additional adds like highlighting changes or images zoom.
精彩评论