0

I am trying to export my tex file to a PDF but it is not working. When I open TeXworks (under pdfLaTeX) and hit the green run button, it opens a window and displays my pdf correctly. However, when I click File > Save As and save it as a pdf and then try and open it in Chrome, it says "Failed to load PDF document".

Does anyone know what might be causing this?

Here is my code after removing all personal information:

\documentclass{article}

\usepackage{titlesec}
\usepackage{titling}
\usepackage[a4paper, top=0.8in, bottom=0.8in, left=1in, right=1in]{geometry}
\usepackage{hyperref}
\usepackage[none]{hyphenat}

\setlength\parindent{0pt}

\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,      
    urlcolor=blue,
}

\urlstyle{same}

\titleformat{\section}
{\fontsize{15}{25}\bfseries}
{}
{0em}
{}[\titlerule]

\titlespacing{\section}
{0em}{2.5em}{1.8em}

\titleformat{\subsection}
{\fontsize{10}{0}\bfseries}
{}
{0em}
{}

\titlespacing{\subsection}
{0em}{2em}{0.85em}

\renewcommand{\maketitle}{
\begin{center}
{\huge\bfseries
\theauthor}

\vspace{.4em}

email@gmail.com --- number
\end{center}
}

\begin{document}
\title{Resume}
\author{A B}

\maketitle

\section{Personal profile}

x

\section{Education}

\subsection{University of Example, BSc (Hons) in Computer Science\hfill A - B }

X\\[0.08in] Y:

\begin{itemize}
\item 1
\item 2
\item 3
\item 4
\item 5
\item 6
\item 7
\item 8
\end{itemize}


\subsection{School\hfill A - B}

\begin{itemize}
\item A --- B
\item A --- B
\end{itemize}

\section{Technical skills}

\subsection{A}

B

\subsection{A}

B

\subsection{A}

B

\subsection{A}

B

\subsection{A}

B

\subsection{A}

B

\subsection{A}

B

\section{A}

\subsection{X (\href{https://www.google.co.uk}{A}, \href{https://www.google.co.uk}{B}) --- x}

x

\subsection{X (\href{https://www.google.co.uk}{A}, \href{https://www.google.co.uk}{B}) --- x}

x


\end{document}

Thanks.

1

TeXworks supplied with MiKTeX has several options to save as, and it is not apparent to a user that when you "save as" PDF you are most likely saving the TeX file with an incorrect PDF extension !

it is easy to see the editor now is editing filename.pdf !!!

One easy way to get the PDF into an external PDF viewer is to ask for a print ! That is the natural way in windows to call a "print to PDF"

HOWEVER

On Windows MiKTeX it tells me It can't and do I want to open the PDF in a viewer !!

I can then print or save the pdf there at will

  • File > Print Pdf in the pdf window of TeXworks worked, thanks. – J P Mar 20 at 14:15
  • When the file is typeset the pdf is created---there is no need to Save As…. When you ``convert'' (typeset) file.tex the process creates file.pdf. – Herb Schulz Mar 20 at 17:44
  • @HerbSchulz I know but often running a file in a build directory sometimes one wants to save a copy elsewhere so I find in that editor I very frequently use the print trick to open in SumatraPDF where I can then save as to another folder for me is quicker than open Save as, Change the setting from Tex to Pdf, Select the file with right copy, Navigate to the paste location, Then have to paste the file and Re-open it with viewer to check it is OK ! – user170109 Mar 20 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.