Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. private void crearPDFCarta(String nombreArchivo, String contenidoCarta) throws DocumentException, IOException {
  2.  
  3. Document documento = new Document();
  4. PdfWriter.getInstance(documento, new FileOutputStream(nombreArchivo));
  5. documento.open();
  6. List<Element> objects = HTMLWorker.parseToList( new StringReader( contenidoCarta ), null );
  7.  
  8.     for (Element element : objects){
  9.       documento.add( element );
  10.     }
  11. documento.close();
  12.  
  13. }