izuzak / atom-pdf-view

Support for viewing PDF files in Atom.
https://atom.io/packages/pdf-view
MIT License
106 stars 30 forks source link

auto-reload on update doesn't not work #213

Open glglgithub opened 6 years ago

glglgithub commented 6 years ago

I use auto-pdf-view together with latex tool in atom on win10. When latex file is updated and rebuilt, the pdf file is updated however not reloaded in the pdf-viewer panel. It has to manually close the tab and reopen in order to view the latest file....

ptitjes commented 5 years ago

I confirm this behaviour on Linux. However this might not be due to pdf-view but to the latex plugn or latexmk. Indeed, if you open the result pdf in a file manager (nautilus) then it does not reload automatically after build (where it used to). May it be that the copying from the latex plugin from .build/main.pdf to main.pdf doesn't notify the system for a file change ?

ptitjes commented 5 years ago

OK, my bad. It seems I had not enough inotify watches. I did the following and it fixed my problem:

echo "fs.inotify.max_user_watches=204800" | sudo tee -a /etc/sysctl.d/90-override.conf
WSDeWitt commented 5 years ago

I am also not getting the pdf to update after recompiling. I have to close the file and reopen.

jackbshim commented 5 years ago

I have the exact same issue on two of my Windows 10 machines.

allefeld commented 4 years ago

Same here on Debian 10

micahjsmith commented 4 years ago

Same here on macOS Catalina, pdfs reload automatically in external Preview but not in pdf-view.

allefeld commented 4 years ago

In the meantime, I made my own PDF viewer package for Atom:

https://atom.io/packages/pdfjs-viewer

It is designed as a drop-in replacement for pdf-view, and supports automatic reloading, as well as a bunch of other features. Feedback welcome.

micahjsmith commented 4 years ago

Looks fantastic!

Fully functional, auto-update issue is solved on pdfs-viewer.

Thanks Carsten!

allefeld commented 4 years ago

@micahjsmith glad you like it!

WSDeWitt commented 4 years ago

@allefeld Looks cool, although I'm finding the same issue on macOS Catalina: pdf refreshes in the Preview app after a new tex build, but does not reload in the pdfjs-viewer interface.

allefeld commented 4 years ago

@WSDeWitt could you open the developer tools and see whether there are any error messages at the time the PDF is opened, and at the time it should be reloaded?

It can also depend on the way the pdf is recreated. If the file is first deleted, and then created again, file watching fails because it is based on inodes.

In any case, feel free to create an issue on my repository.

WSDeWitt commented 4 years ago

@allefeld Thanks! Indeed this seems related to the pdf recreation method. I am using SCons for TeX build, which by default deletes targets before rebuilding. This SCons behavior can be prevented with the Precious function. This solves the refresh issue in atom-pdf-view, but causes an error in pdfjs-viewer (I will create an issue on that repo).