General ⇒ closing documents when using Foxit
closing documents when using Foxit
I've started using FoxIt instead of Acrobat (a great improvement!) and got it to work fine in TeXniccenter except I haven't figured out a way to have the document automatically be closed before I open it again. I'm thinking this might not be possible since FoxIt doesn't have DDE support, but does anyone know for sure? Any ideas for a workaround? thanks!
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: closing documents when using Foxit
Hello, (excuse my english ...)
you can try the autohotkey script :
loop ,%1%
{
IfWinExist, %A_LoopFileName%
WinClose ; use the window found above
}
Run,%1%
compile the script
copy the .exe in a folder (C:\Program Files\CloseFoxit)
and call it instead foxit
in Texnicenter Build>outputprofile>viewer
path of executable : C:\Program Files\CloseFoxit\CloseFoxit.exe
command line argument : %bm
I join the compiled script
Best regards
you can try the autohotkey script :
loop ,%1%
{
IfWinExist, %A_LoopFileName%
WinClose ; use the window found above
}
Run,%1%
compile the script
copy the .exe in a folder (C:\Program Files\CloseFoxit)
and call it instead foxit
in Texnicenter Build>outputprofile>viewer
path of executable : C:\Program Files\CloseFoxit\CloseFoxit.exe
command line argument : %bm
I join the compiled script
Best regards
-
- Posts: 3
- Joined: Wed Nov 07, 2007 8:30 pm
closing documents when using Foxit
Nice idea. Thanks. Maybe my solution inspired by yours helps, too.
closing documents when using Foxit
Success!
First of all, thanks for the hints. Things didn't go all that smoothly, of course, but who would expect that?
Here are the problems I remember, in approximate order...
1. "taskkill" is a windows XP command. If you use Windows 2000 (like me) then the appropriate command is simply "kill".
2. The command "kill" is not included with a typical install of Windows 2000...It's pretty easy to install from your Windows 2000 cd. See http://seer.entsupport.symantec.com/docs/253904.htm
3. The filename of the Foxit Reader executable is "Foxit Reader.exe"...I think the old batch system doesn't like filenames like that or something, because I had a devilish time trying to reference it. Luckily, Foxit is a self-contained program so I just changed the filename to the very friendly "foxit.exe".
4. Since I often have .pdf articles open as well as the .pdf for the .tex file I am working on, I want the kill command to search out the right .pdf file to close.
So anyways, here's my solution:
In TexnicCenter Output Profile:
path of executible: "C:\Foxit Reader\foxit_close.bat"
view project output command line argument: "%bm.pdf" %tm
(the quotes like that are important)
forward search command line argument: [empty]
close document before running (La)tex: Do Not Close
And my foxit_close.bat file:
The only subtlety is passing %tm, which is the "title" of the Latex document, as parameter %2. If you are using Foxit and your file is foo.pdf then the window title will look something like "foo.pdf - Foxit Reader 2.2 - [foo.pdf]". So if you, like me, name your files the same as your titles in your latex documents then you are in business since the title, %tm, will be "foo" and KILL %2* will kill any window that starts with "foo"....Not foolproof, but works with the least amount of effort. Might have to think of something more clever later.
Anyway, thanks again for the helpful suggestions...hopefully with our three solutions anybody else coming across this problem will have enough to work with 8)

First of all, thanks for the hints. Things didn't go all that smoothly, of course, but who would expect that?

Here are the problems I remember, in approximate order...
1. "taskkill" is a windows XP command. If you use Windows 2000 (like me) then the appropriate command is simply "kill".
2. The command "kill" is not included with a typical install of Windows 2000...It's pretty easy to install from your Windows 2000 cd. See http://seer.entsupport.symantec.com/docs/253904.htm
3. The filename of the Foxit Reader executable is "Foxit Reader.exe"...I think the old batch system doesn't like filenames like that or something, because I had a devilish time trying to reference it. Luckily, Foxit is a self-contained program so I just changed the filename to the very friendly "foxit.exe".
4. Since I often have .pdf articles open as well as the .pdf for the .tex file I am working on, I want the kill command to search out the right .pdf file to close.
So anyways, here's my solution:
In TexnicCenter Output Profile:
path of executible: "C:\Foxit Reader\foxit_close.bat"
view project output command line argument: "%bm.pdf" %tm
(the quotes like that are important)
forward search command line argument: [empty]
close document before running (La)tex: Do Not Close
And my foxit_close.bat file:
Code: Select all
KILL %2*START "C:\Foxit Reader\foxit.exe" %1
Anyway, thanks again for the helpful suggestions...hopefully with our three solutions anybody else coming across this problem will have enough to work with 8)
closing documents when using Foxit
Thanks a lot ben16, it works just great !
Cheers,
Cheers,
closing documents when using Foxit
Using Windows XP I did almost the same as evencoil:
Because I like to use Foxit's feature to remember the view settings, I do not kill it forcefully. This takes some time however, which is why I added the sleep command. Otherwise the new window would be opened before the old one is closed. Depending on your system you might want to vary the sleep time (the number behind sleep).
If you do not care about the aforementioned feature, the following foxit_close.bat is sufficient:
However I needed to use a different foxit_close.bat for Windows XP:In TexnicCenter Output Profile:
path of executible: "C:\Foxit Reader\foxit_close.bat"
view project output command line argument: "%bm.pdf" %tm
(the quotes like that are important)
forward search command line argument: [empty]
close document before running (La)tex: Do Not Close
Code: Select all
taskkill /fi "Windowtitle eq %2*" /im Foxit*sleep 0.5START "C:\Foxit Reader\Foxit Reader.exe" %1
If you do not care about the aforementioned feature, the following foxit_close.bat is sufficient:
Code: Select all
taskkill /f /fi "Windowtitle eq %2*" /im Foxit*START "C:\Foxit Reader\Foxit Reader.exe" %1
-
- Posts: 1
- Joined: Tue Mar 16, 2010 9:28 pm
Re: closing documents when using Foxit
An autohotkey script could be a best thing to use on that kind of documents setting. Using the Foxit could not be so easy for me, because I've not been using it often.
closing documents when using Foxit
Yes, use if you want to waste lots of system resources unnecessarily.spiegboy wrote:use acrobat reader
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
closing documents when using Foxit
The Adobe Reader in its versions >=8 has turned out to be not the ideal partner for TeXnicCenter (TXC). It locks opened files and so prevents them from being updated after an additional LaTeX run. Although it can close files before the next run, it doesn't reload automatically. Furthermore it doesn't support SyncTeX for synchronization between source code and PDF output. A much better viewer for use with LaTeX and especially TXC is SumatraPDF. The current alpha version of TXC2 recognizes if it is already installed on the system and automatically generates an according output profile.spiegboy wrote:use acrobat reader
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10