如何在PDF查看器上自动刷新?

Lei*_*Lei 12 pdf refresh viewer

我在Windows Vista系统上编辑LaTeX.我用它pdflatex来不断生成PDF文件.

我的PDF查看器是Adobe Acrobat Professional 7,每次我必须关闭并打开相同的文件才能获得新的外观.

有没有办法让PDF查看器在更改后刷新PDF页面?

Rem*_*emi 12

查看器不会定期检查磁盘上的更改,因此简短回答:否(不幸的是)

但是,您可以使用浏览器在自己的html"网页"中查看pdf文件,该网页会定期使用javascript刷新页面.

这是如何(包括在手动和自动刷新之间切换的按钮):

<!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>
Run Code Online (Sandbox Code Playgroud)

只需将此代码保存为与PDF格式相同的文件夹中的"pdfrefresher.html"即可.从src嵌入对象开始,您只使用文件名,例如'myPdfFile.pdf'(不是磁盘或目录).在代码中,您可以调整嵌入对象的宽度和高度以及超时(以毫秒为单位).


For*_*say 12

超级用户的问题

对于Windows,SumatraPDF是免费的,并且可以与LaTeX很好地配合使用.更新pdf时会自动刷新.

这也很便携,很不错.


小智 5

Evince pdf 查看器自动刷新。

它是一个极其轻便且免费的 (GNU) pdf 查看器,是大多数 linux 操作系统上的默认浏览器。还有一个Windows版本。虽然,我只在 linux 中使用过 evince,但我确信它在 Windows 中具有相同的功能。