Update on 2008-01-24:
The “back” feature is no longer needed, at least on Windows Acrobat Reader 8. See: Edit->Preferences->Documents->Restore last view settings when reopening documents
Update on 2007-01-30:
I have patched the source and replaced the zip files so that pdfclose will be less likely to crash Adobe Reader 8. Thanks to this post. Also, apparently pdfopen cannot issue a “back” command to Adobe Reader and you need the full version for that feature.
If you are a Windows user and use Acrobat or Adobe Reader(*) to view PDF files, you may have experienced Acrobat locking your PDF file, making it impossible to overwrite. This is a serious problem when previewing your paper in the PDF format because every time before you generate a new PDF, you need to remember closing the old PDF in Acrobat.
Part of my solution to this problem is to open the PDF using pdfopen:
pdfopen --file foo.pdf
This will allow me to close foo.pdf by:
pdfclose --file foo.pdf
Integrating these two commands into your work-flow is left as an exercise to the reader.
But there is still an important usability problem that these two commands won’t solve. Every time you re-open a PDF, you will not be on the same page when you closed it. Instead, you will be on the first page. How would I to fix this? One solution would be to press Alt-Left after I re-opened the PDF file. This goes back in history and brings me to the last view I was at. But I’ve got something better.
I’ve modified the source code of pdfopen from TUG to include an extra option --back to do the obvious thing. So instead of the above, you should open a PDF file by:
pdfopen --file foo.pdf --back
Now the cycle is complete. Phew!
I have posted the exe files in a zip. The source files are available too.
For the record, you can obtain the original pdfopen and pdfclose at this URL:
http://www.tug.org/tex-archive/systems/win32/web2c/current/binary/bin-pdftools-win32.zip
BTW, I’ve read that recent versions of TeXnicCenter and WinEdt can both perform this Acrobat cycle too. But I am not sure if they can go back to the previous view. Heh, surely I know my Emacs can.
P.S. I am also aware that you can use gsview32 to preview PDFs and gsview32 does not lock PDF files. That’s one way to avoid this problem.
(*) Really, it’s called Adobe Reader. I don’t know since when they dropped the middle word.
Hello,
how do I configure emacs to start pdfopen for viewing a *.pdf file?
What has to be the value of the variable tex-output-view-style?
I tried “C:\Programme\MiKTeX 2.5\miktex\bin\pdfopen.exe” but nothing happens… uhm.
Thanks!
I’m using TexNicCenter and Adobe Reader 8.1. I can’t get the the “back”-feature to work even though I check the box as suggested on 2008-01-24. Are there any other settings that is needed to get this to work?
Thanks!
Thomas, I do not use TNC and therefore I have no fix for you. But I can guess what *may* be happening to you: TNC tries to circumvent the PDF locking issue by generating a new PDF each time with a different file name. So even though you have the “back” setting in AR8, you are invoking AR8 on a different file each time…
As for how to fix this, you may have better luck asking in TNC’s forums. Sorry!
I have the same problem as Thomas, and it not depends on TNC but only about open/close pdf
and mainly on Adobe Acrobat (pro).
It seems that Acro/adobe Reader works differently on Adobe Acrobat.
Maybe you can find the solution
Even if ‘restore last view’ enabled, Acrobat 7.0 Pro only restore last view for the same file, if compiled and generated by LaTeX, Acrobat treats it like a new file and thus no ‘last view’ for it.
I really like a re-implementation for the ‘back’ option, please.
Thank you.