# MiKTeX can't write on pdf file [closed]

I am using MiKTeX 2.9 on Windows 7.

I'm getting the error: "can't write on pdf file." The pdf doesn't reflect what I wrote. What did I do wrong?

My input:

\documentclass[12pt]{article}
\usepackage{epsf}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{rotate}
\usepackage{endnotes}
%\usepackage{harvard}
\usepackage{vmargin}
\usepackage{natbib}
\bibliographystyle{apsr}

\oddsidemargin=1.0in\evensidemargin=0.in
\textheight=8.5in\textwidth=6.6 in \baselineskip=18pt \parskip=6pt

TEXT

\newpage \baselineskip=12pt
\doublespacing

\bibliographystyle{apsa}
\bibliography{Dissertation_Proposal}

\end{document}

-

## closed as too localized by Joseph Wright♦Oct 22 '12 at 7:39

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

You're missing a \begin{document}. I'm guessing the log file will state this clearly or your editor. –  pythonista Oct 19 '12 at 20:38
No, I have: \oddsidemargin=1.0in\evensidemargin=0.in \textheight=8.5in\textwidth=6.6 in \baselineskip=18pt \parskip=6pt %opening \title{Title} \author{Author} \begin{document} \maketitle \begin{abstract} –  user21127 Oct 19 '12 at 20:40
I can't see what you posted in the comment in the actual question. –  pythonista Oct 19 '12 at 20:43
This can happen when the output PDF file is locked by another application, e.g. it is open in Adobe Reader. –  cyberSingularity Oct 19 '12 at 20:54
You were right. The error was caused by the pdf already being open. Closing it fixed the problem. Thanks! –  user21127 Oct 19 '12 at 21:07

The error message is generated by the prompt_file_name procedure in TeX.
• One cannot type x at this prompt to abort. That will write on a file called x.pdf.
• In pdflatex, pressing ENTER without retyping the filename unhelpfully writes on a file called .pdf.
• In lualatex, pressing ENTER without retyping the filename prompts again.
• In xelatex, this prompt doesn't occur. Instead, one seems to get the message ** ERROR ** Unable to open ... and then it exits.