[Tex/LaTex] I can’t write on file ‘Filename.pdf’

texmakertexstudio

Im new to latex and sometimes I get this error message:

line 5: ! I can't write on file 'MasterThesis.pdf'. Please type another file name for output! Emergency stop.<to be reaad again>... ...\end{document}
Line 1: !==> Fatal error occured, no output PDF file produced!

Today when I got this message nothing seems to work to fix it. I have tried the following:

  • Installed a new editor which gives the same error (TeStudio and TexMaker)
  • Deleted all files except the tex file
  • Close all programs and processes in task manager that seems to be PDF-related
  • Restart the editor (TexMaker)
  • Reboot the computer
  • I got several GB left on the disk drive
  • Searched through the internet to find a solution
  • Rename the tex file to only letters (no spaces, dots, symbols, etc)
  • Change the name of the folder that contains the file

Last thing I did was to remove everything in the tex file (with backup of course) except for the following:

\documentclass[12pt, a4paper]{article}

\begin{document}
    Hello
\end{document}

But I still get the same error.

If I create a new empty file it manage to compile. Then I paste my work into it and the error occures. So I press ctrl+z a couple of times to undo until I reach the document that works but then the error is still there
Im using Windows 8 and TexMaker.

Im working on my master thesis and it's very frustrating when I can't continue my work. Could someone please help me with this?

Best Answer

I had the same problem. If you use Adobe Acrobat reader X, go to the Preferences of Acrobat Reader. In the menu Security (Enhanced) deselect Protection and Protection Enhanced OR add the Folder Path of your pdf folder build with latex.
That's work with me !