GeneralClose Adobe Reader before Compilation

General information and discussion about TeXnicCenter
Post Reply
dltx
Posts: 4
Joined: Sat Jan 14, 2012 8:04 am

Close Adobe Reader before Compilation

Post by dltx »

Not sure if this has come up before, but a cursory search of recent posts did not turn up anything.

Frequently after running PDFLaTeX on the current file and viewing the output on Adobe Reader, I forget to close Adobe Reader. After further editing, I try to run PDFLaTeX again but because I did not close Adobe Reader, PDFLaTeX aborts because it cannot write to the open PDF file. Is there a simple way to ensure that if the current file has a PDF file open, that it is closed before PDFLaTeX is executed? Something like a command line switch in the profile?
Last edited by dltx on Mon Jan 16, 2012 9:38 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Close Adobe Reader before Compilation

Post by Frits »

Not really my cup of tea, but maybe this post on the LaTeXEditor forum is helpful.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
dltx
Posts: 4
Joined: Sat Jan 14, 2012 8:04 am

Re: Close Adobe Reader before Compilation

Post by dltx »

thanks for the reply. this is exactly what i'd like to do, but i'd like to do it in texniccenter. the solutions provided in that thread all seem to be achieved by running a script that closes the pdf viewer before latex compilation. but texniccenter does not seem to offer the possibility of running a preprocessor (it offers only the option of a postprocessor) in defining output profiles, or am i mistaken? maybe i'll have to figure a hack to do this, but wondered if anybody else using texniccenter had already found an easy solution.
dltx
Posts: 4
Joined: Sat Jan 14, 2012 8:04 am

Re: Close Adobe Reader before Compilation

Post by dltx »

just for closure, for those interested in doing something similar, i got the following hack to work. i write the pdf output to a different temporary filename (so not the default faultname) using the pdflatex switch, job-name. this allows me to do post-processing on the temporary filename in a batch file. in the batch post-processing, i taskkill the reader (acrord32.exe), delete the original file, then rename the temporary filename back to the original filename, so the end result is as if i didn't do anything. not necessarily the most elegant hack, but it looks like it works.
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

Re: Close Adobe Reader before Compilation

Post by MartinC »

You would be much better using sumatrapdf as a pdf reader. You don't have to close the file *and* you get forward and inverse search.
dltx
Posts: 4
Joined: Sat Jan 14, 2012 8:04 am

Re: Close Adobe Reader before Compilation

Post by dltx »

i was tempted to install the sumatra reader in trying to solve this, but i didn't really want to install another piece of software. but certainly for most, using the sumatra reader might be the easiest solution.
Post Reply