\hypertarget{index_dvi2bitmap-overview}{}\section{Overview}\label{index_dvi2bitmap-overview}
The {\ttfamily dvi2bitmap} library provides an object model for D\-V\-I files, and for the bitmaps which one may wish to transform them into.

For full documentation of the D\-V\-I and P\-K formats, see the Level-\/0 D\-V\-I Driver Standard, which is available on-\/line on C\-T\-A\-N, in the directory \href{http://www.tex.ac.uk/tex-archive/dviware/driv-standard}{\tt dviware/driv-\/standard}.

For details of the classes available in the library, see the {\itshape Class Hierarchy} link above.\hypertarget{index_examplecode}{}\section{Example code}\label{index_examplecode}
For an example of how to use the library, see the simple {\ttfamily \hyperlink{dvireport_8cc}{dvireport.\-cc}} utility in the distribution.

The outline of that program is as follows\-: 
\begin{DoxyPre}
   DviFile* dvi;
   try \{
     dvi = new DviFile(dviname);
   \} catch (\hyperlink{classDviError}{DviError}\& e) \{
     cerr << "Can't open DVI file " << dviname
          << ": " << e.problem() << endl;
     exit (1);
   \}\end{DoxyPre}



\begin{DoxyPre}   \hyperlink{classDviFileEvent}{DviFileEvent} *ev;
   bool end\_of\_file = false;\end{DoxyPre}



\begin{DoxyPre}   try \{
     while (!end\_of\_file) \{
         ev = dvi->getEvent();\end{DoxyPre}



\begin{DoxyPre}         if (\hyperlink{classDviFileSetChar}{DviFileSetChar} {\itshape test = dynamic\_cast<\hyperlink{classDviFileSetChar}{DviFileSetChar}}>(ev)) \{
             // do stuff\end{DoxyPre}



\begin{DoxyPre}         \} else if (\hyperlink{classDviFileSetRule}{DviFileSetRule} {\itshape test
               = dynamic\_cast<\hyperlink{classDviFileSetRule}{DviFileSetRule}}>(ev)) \{
             // do more stuff\end{DoxyPre}



\begin{DoxyPre}         [...]
         \} else if (\hyperlink{classDviFilePostamble}{DviFilePostamble} {\itshape post
               = dynamic\_cast<\hyperlink{classDviFilePostamble}{DviFilePostamble}}>(ev)) \{
        end\_of\_file = true;
         \}\end{DoxyPre}



\begin{DoxyPre}         ev->release();
     \}
   \} catch (\hyperlink{classDviError}{DviError}\& e) \{
     cerr << "Error processing DVI file" << endl;
   \}\end{DoxyPre}



\begin{DoxyPre}   delete dvi;
\end{DoxyPre}
 