Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > media > contrib-release > by-pkgid > 29e0da3ddcddab73ae8621fc62033227 > files > 130

itext-manual-1.4.5-1mdv2007.0.i586.rpm

/*
 * $Id: Info.java,v 1.2 2005/05/09 11:52:50 blowagie Exp $
 * $Name:  $
 *
 * This code is part of the 'iText Tutorial'.
 * You can find the complete tutorial at the following address:
 * http://itextdocs.lowagie.com/tutorial/
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * itext-questions@lists.sourceforge.net
 */
package com.lowagie.examples.general.read;

import java.io.BufferedWriter;
import java.io.FileWriter;

import com.lowagie.text.pdf.PdfReader;

/**
 * Getting information from a PDF file.
 */
public class Info {
	/**
	 * Getting information from a PDF file
	 * @param args 	the names of paths to PDF files.
	 */
	public static void main(String[] args) {
		try {
		BufferedWriter out = new BufferedWriter(new FileWriter("info.txt"));
        for (int i = 0; i < args.length; i++) { 
        	PdfReader r = new PdfReader(args[i]);
            out.write(args[i]);
            out.write("\r\n------------------------------------\r\n");
        	out.write(r.getInfo().toString());
        	out.write("\r\n------------------------------------\r\n");
        }
        out.flush();
        out.close();
		}
		catch(Exception e) {
			e.printStackTrace();
		}
	}

}