Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: déboguer un document PDF

Java: déboguer un document PDF
{filelink=10389}

/***** Code de MesExemples.com *******/
/**
 * @(#)DebugPDFDocuments.java
 *
 *
 * @author 
 *sakoba(java.mesexemples.com) @version 1.00 2013/4/27
 */
 
 
import java.io.FileOutputStream;
import java.io.IOException;
 
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
 
public class DebugPDFDocuments {
  public static void main(String[] args) {
    Document document = new Document();
    try {
      PdfWriter.getInstance(document, System.out);
      PdfWriter.getInstance(document,
      new FileOutputStream("c:/DebugPDFDocuments.txt"));
      document.open();
      document.add(new Paragraph("Bienvenu sur le programme pdf java"));
    } catch (DocumentException de) {
      System.err.println(de.getMessage());
    } catch (IOException ioe) {
      System.err.println(ioe.getMessage());
    }
    document.close();
  }
}