Wednesday, April 24, 2013

TeXnicCenter error: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]

The problem: Recently I installed TeXnicCenter, which, by the way, is my favorite LaTeX editor. As soon as I compiled a document and tried to open the PDF, I saw the following message:

error: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]

See the update from May, 2017 below. 


The cause of this problem is that Adobe Acrobat (not Adobe Reader) is assumed by TeXnicCenter to be the default PDF viewer (perhaps because it was installed before?). As a result of this, the DDE command and the location of the PDF viewer is wrong in the TeXnicCenter configuration right after installation.

During the installation process, TeXnicCenter should read the registry key:
HKEY_CLASSES_ROOT\acrobat\shell\open\command
to determine the location of the Adobe PDF Reader (in my case, C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe). Additionally, TeXnicCenter should read the key:
HKEY_CLASSES_ROOT\acrobat\shell\open\command
to determine the "Server" field.


The solution: There are two steps:

Step 1: In TeXnicCenter Go to Build->Define Output Profiles-> choose "Latex to PDF" -> Viewer tab. Make sure the "Executable path" points to the right file; to know the right file, open the Registry Editor (run regedit). Use the location reported at:
HKEY_CLASSES_ROOT\acrobat\shell\open\command  
(in my case, C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe). Now, use the registry key:
HKEY_CLASSES_ROOT\acrobat\shell\open\ddeexec\application
to determine the word you have to use in the "Server" field (in my case, AcroViewR10).


Step 2: In Adobe Reader X, go to Edit>Preferences>General and uncheck "Enable Protected Mode at startup".

UPDATE August 2015: I got a similar problem using Acrobat Reader DC, TeXnicCenter 2.02, and Windows 10.

The solution in this case was to change the key HKEY_CLASSES_ROOT\acrobat\shell\open\ddeexec\application in STEP 1 to AcroViewR15.

The Server field in the Viewer section of the Profiles window (ALT+F7) has to be changed to AcroViewR15. It has to be done for all profiles in TeXnicCenter that use PDF, e.g. LaTeX->DVI->PDF, etc.

I had to reinstall TeXnicCenter for the solution to work.

UPDATE May 2017: On April 2017, Acrobat Reader DC changed again. The DDE parameter has to be AcroViewR17

29 comments:

  1. This did not fix my issue.
    TexMaker works fine and launched the .PDF.

    ReplyDelete
  2. I got a similar problem using Acrobat Reader DC and TeXnicCenter 2.02.

    The solution in this case was to change the key HKEY_CLASSES_ROOT\acrobat\shell\open\ddeexec\application in STEP 1 to AcroViewR15.

    The Server field in the Viewer section of the Profiles window (ALT+F7) has to be changed to AcroViewR15. It has to be done for all profiles in TeXnicCenter that use PDF, e.g. LaTeX->DVI->PDF, etc.

    I had to reinstall TeXnicCenter for the solution to work.

    ReplyDelete
  3. My solution was,

    Check "Command line argument" instead of "DDE command" on:
    Build\Define Output Profiles\LaTeX->PDF\Viewer\View project's output
    and
    Build\Define Output Profiles\LaTeX->PDF\Viewer\Forward search

    Finally, in both text boxes insert: %bm.pdf

    ReplyDelete
  4. Thanks a lot, that worked perfect! Didn't even need to reinstall TeXnic!

    ReplyDelete
  5. Thanks! The Update solved my problem :)

    ReplyDelete
  6. The Update did solve my problem! Very nice job, thanks! :)

    ReplyDelete
  7. The Server field in the Viewer section of the Profiles window (ALT+F7) has to be changed to AcroViewR15.

    Thanks a lot lot ...

    ReplyDelete
  8. Excellent! Only I had changed to AcroView15! Thank you very much

    ReplyDelete
  9. Muito obrigado! Ajudou muitíssimo! Felicidades!

    ReplyDelete
  10. Solved my problem with Adobe DC and Win 10. Thanks!

    ReplyDelete
  11. Gracias, pude solucionar mi error en windows 8.1

    ReplyDelete
  12. Jesus!!!!! THANK YOU SO MUCH FOR SAVING MY LIFE!!!!

    ReplyDelete
  13. Thank you very much for you post.

    ReplyDelete