Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2002
    Messaggi
    483

    [JSP] libreria com.lowagie.text.*

    Ciao ragazzi, su questo forum mi sono copiato il seguente script:
    codice:
    <%@
    page import="java.io.*,
    			 com.lowagie.text.*,
    			 com.lowagie.text.pdf.*"
    %><%
    //
    // Template JSP file for iText
    // by Tal Liron
    //
    
    response.setContentType( "application/pdf" );
    
    // step 1: creation of a document-object
    Document document = new Document();
    
    // step 2:
    // we create a writer that listens to the document
    // and directs a PDF-stream to a temporary buffer
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    PdfWriter.getInstance (document, buffer);
    
    // step 3: we open the document
    document.open();
    
    // step 4: we add a paragraph to the document
    document.add(new Paragraph("Hello World"));
    
    // step 5: we close the document
    document.close();
    
    // step 6: we output the writer as bytes to the response output
    DataOutput output = new DataOutputStream( response.getOutputStream() );
    byte[] bytes = buffer.toByteArray();
    response.setContentLength(bytes.length);
    for( int i = 0; i < bytes.length; i++ ) { output.writeByte( bytes[i] ); }
    %>
    come avrete notato questo script mi serve per creare un pdf.
    Il problema è che mi manca la libreria com.lowagie.
    Me la sono scaricata ed il nome del file è questo: itext-1.3.jar
    Perchè quando cerco di far partire il tomcat non parte? Io ho inserito qusto file in common/lib
    Dove sbaglio? il driver è giusto?
    Grazie mille a tutti

  2. #2
    Utente di HTML.it
    Registrato dal
    Mar 2002
    Messaggi
    483
    non mi aiuta nessuno?
    Non sapere dove devo inserite la libreria?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.