private void doMain() {
	    for (String filename : filenames) {
            File inputFile = new File(filename);
            TextExtractor te = null;
            
            try {
                te = parsePdf(inputFile);
                System.out.println(te.toXml());
            } catch (IOException e) {
                System.err.println("Couldn't read file '" + inputFile +"'.");
                System.exit(1);
            }
            
            try {
                if (maskImagePage > 0) {
                    BufferedImage maskImage = te.toMaskImage(maskImagePage);
                    ImageIO.write(maskImage, "png", new File("mask.png"));
                }
            } catch (IOException e) {
                System.err.println("Couldn't write mask image 'mask.png'.");
                System.exit(1);
            }
            
        }
	}