Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 970
Lei Avatar asked Sep 13 '11 11:09

Lei


People also ask

How do you refresh a PDF?

Current Adobe Reader 9.4. 2 allows you to press Ctrl + R to reload an opened PDF.

Why is my PDF not auto filling?

Troubleshooting tips for completing forms If you're having trouble filling in and submitting forms, check the following conditions: Make sure that the security settings allow form filling. (See File > Properties > Security.) Make sure that the PDF includes interactive, or fillable, form fields.

How do I fix lag in PDF?

Optimize your PDF for web Web optimization will make the file smaller and will take significantly less time for loading. To optimize your PDF, open it in Acrobat Pro, click on the Advanced tab and then click on PDF Optimizer. This shows you what is going to be optimized. Click OK and save the file.

How do I auto-refresh the view of a PDF file?

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...

Does the PDF viewer automatically refresh when a PDF is updated?

It will automatically refresh when the pdf is updated. It's also portable, which is nice. Show activity on this post. The viewer does not regularly check changes on disk, so short answer: no (unfortunately)

How do I change the default viewer for a PDF file?

Right-click on the thumbnail of any PDF file. On the menu, click Properties. A new dialog box will appear. In the first subsection, the text “Opens with:” indicates which PDF viewer is set as your default. Click the Change button. Select Adobe Acrobat DC or Reader from the list as your default.

How do I view my PDF file?

You can view your PDF by clicking either View in VSCode tab or View in web browser in the LaTeX Workshop menu. When you update and save the tex file, it will update the PDF file automatically. LaTeX menu.


2 Answers

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.

like image 129
ForbesLindesay Avatar answered Sep 20 '22 22:09

ForbesLindesay


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).

like image 40
Remi Avatar answered Sep 21 '22 22:09

Remi