\documentclass[ngerman]{scrartcl}
\usepackage{babel}
\usepackage[ansinew]{inputenc}
\usepackage{hyperref}

% ----------------------------------------------------------------
% ----------------------------------------------------------------
\begin{document}
% ----------------------------------------------------------------
\title{Testdokument}
\author{
    \href{mailto:knut@lickert.net}{Knut Lickert}\\
    }
\maketitle

\section{\TeX/\LaTeX/\LaTeXe}
\ifx\NeedsTeXFormat\undefined%
  \ifx\documentstyle\undefined%
    Es wird weder LaTeX2e noch LaTeX2.09 verwendet
    \message{You're not using LaTeX2e or LaTeX2.09}
  \else
    Es wird LaTex2.09 verwendet
    \message{You're not using LaTeX2.09}
  \fi
\else
  Es wird \LaTeXe verwendet.
  \message{You're using LaTeX2e}
\fi

\section{DVI oder PDF?}
\subsection{Variante 1}
\newif\ifpdf
\ifx\pdfoutput\undefined
  \pdffalse % we are not running PDFLaTeX
  \message{LaTeX is used.}
  \LaTeX\ mit dvi
\else
  \pdfoutput=1 % we are running PDFLaTeX
  \pdftrue
  \message{pdfLaTeX is used}
  pdf\LaTeX mit dvi
\fi

\subsection{Variante 2}

\ifx\pdfoutput\undefined
  \pdffalse % we are not running PDFLaTeX
  \message{LaTeX is used.}
  \LaTeX\ mit dvi
\else % we are running PDFLaTeX
  pdf\LaTeX\ mit
  \message{pdfLaTeX is used}
  \ifnum \pdfoutput=0
    \pdffalse
    DVI-output
  \else
    \ifnum\pdfoutput=1 % we are running PDFLaTeX
    \pdftrue
    PDF-Output
    \fi
  \fi
\fi


%
%\makeatletter
%\@ifundefined{pdfoutput}\% Definitely not using pdftex.
%{\% Standard TeX
%
%} {\% Running pdftex.
%\ifnum\pdfoutput=0\relax% Are we outputting pdf?
%\% No it is dvi output
%\usepackage[dvips]{graphicx,color}
%\fi
%\ifnum\pdfoutput=1\relax% Are we outputting pdf?
%\% Yes it is pdf output
%\usepackage[pdftex]{graphicx,color}
%\fi
%}
%\makeatother



\end{document}
% ----------------------------------------------------------------
