Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

Dvi2Bitmap library

dvi2bitmap0.13

Overview

The dvi2bitmap library provides an object model for DVI files, and for the bitmaps which one may wish to transform them into.

For full documentation of the DVI and PK formats, see the Level-0 DVI Driver Standard, which is available on-line on CTAN, in the directory dviware/driv-standard.

For details of the classes available in the library, see the Class Hierarchy link above.

Example code

For an example of how to use the library, see the simple dvireport.cc utility in the distribution.

The outline of that program is as follows:

    DviFile* dvi;
    try {
	dvi = new DviFile(dviname);
    } catch (DviError& e) {
	cerr << "Can't open DVI file " << dviname
	     << ": " << e.problem() << endl;
	exit (1);
    }

    DviFileEvent *ev;
    bool end_of_file = false;

    try {
	while (!end_of_file) {
	    ev = dvi->getEvent();

	    if (DviFileSetChar *test = dynamic_cast<DviFileSetChar*>(ev)) {
              // do stuff

	    } else if (DviFileSetRule *test
		       = dynamic_cast<DviFileSetRule*>(ev)) {
              // do more stuff

          [...]
	    } else if (DviFilePostamble *post
		       = dynamic_cast<DviFilePostamble*>(ev)) {
		end_of_file = true;
	    }

	    ev->release();
	}
    } catch (DviError& e) {
	cerr << "Error processing DVI file" << endl;
    }

    delete dvi;
 

Generated on Sun Aug 21 18:21:02 2005 for dvi2bitmap by doxygen 1.3.8