Example usage for com.lowagie.text Paragraph add

List of usage examples for com.lowagie.text Paragraph add

Introduction

In this page you can find the example usage for com.lowagie.text Paragraph add.

Prototype

public boolean add(Object o) 

Source Link

Document

Adds an Object to the Paragraph.

Usage

From source file:questions.separators.SeparatedWords1.java

public static void main(String[] args) {
    Document document = new Document();
    try {/*from  ww  w.ja v a  2 s  .  c  o  m*/
        PdfWriter.getInstance(document, new FileOutputStream(RESULT));
        document.open();

        Chunk separator = new Chunk(new LineSeparator());

        Paragraph p;
        for (int i = 1000; i < 1040; i++) {
            p = new Paragraph("TEST", new Font(Font.COURIER));
            p.add(separator);
            p.add(new Chunk(String.valueOf(i)));
            p.add(separator);
            p.add(new Chunk(String.valueOf(i + 100)));
            p.add(separator);
            p.add(new Chunk(String.valueOf(i + 200)));
            p.add(separator);
            p.add(new Chunk(String.valueOf(i + 300)));
            document.add(p);
        }
        document.close();
    } catch (Exception de) {
        de.printStackTrace();
    }
}

From source file:questions.separators.StarSeparators.java

public static void main(String[] args) {
    Document document = new Document();
    try {//  w  w w . jav a2  s  .co  m
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(RESULT));
        document.open();

        Paragraph stars = new Paragraph(20);
        stars.add(new Chunk(new StarSeparators()));
        stars.setSpacingAfter(30);

        ColumnText column = new ColumnText(writer.getDirectContent());
        for (int i = 0; i < 5; i++) {
            column.addElement(TEXT);
            column.addElement(stars);
        }
        column.setSimpleColumn(36, 36, 295, 806);
        column.go();
        column.setSimpleColumn(300, 36, 559, 806);
        column.go();
        document.newPage();

        for (int i = 0; i < 50; i++) {
            document.add(TEXT);
            document.add(stars);
        }
        document.close();
    } catch (Exception de) {
        de.printStackTrace();
    }
}

From source file:questions.separators.TabbedWords1.java

public static void main(String[] args) {
    Document document = new Document();
    try {//from www .  ja v  a  2s . co  m
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(RESULT));
        document.open();

        Paragraph p;
        Chunk tab1 = new Chunk(new VerticalPositionMark(), 100);
        Chunk tab2 = new Chunk(new LineSeparator(), 120);
        Chunk tab3 = new Chunk(new DottedLineSeparator(), 200);
        Chunk tab4 = new Chunk(new VerticalPositionMark(), 250);
        Chunk tab5 = new Chunk(new VerticalPositionMark(), 300);

        PdfContentByte canvas = writer.getDirectContent();
        ColumnText column = new ColumnText(canvas);
        for (int i = 0; i < 40; i++) {
            p = new Paragraph("TEST");
            p.add(tab1);
            p.add(new Chunk(String.valueOf(i)));
            p.add(tab2);
            p.add(new Chunk(String.valueOf(i * 2)));
            p.add(tab3);
            p.add(new Chunk(SeparatedWords2.WORDS[39 - i]));
            p.add(tab4);
            p.add(new Chunk(String.valueOf(i * 4)));
            p.add(tab5);
            p.add(new Chunk(SeparatedWords2.WORDS[i]));
            column.addElement(p);
        }
        column.setSimpleColumn(60, 36, 400, 806);
        canvas.moveTo(60, 36);
        canvas.lineTo(60, 806);
        canvas.moveTo(160, 36);
        canvas.lineTo(160, 806);
        canvas.moveTo(180, 36);
        canvas.lineTo(180, 806);
        canvas.moveTo(260, 36);
        canvas.lineTo(260, 806);
        canvas.moveTo(310, 36);
        canvas.lineTo(310, 806);
        canvas.moveTo(360, 36);
        canvas.lineTo(360, 806);
        canvas.moveTo(400, 36);
        canvas.lineTo(400, 806);
        canvas.stroke();
        column.go();

        document.setMargins(60, 195, 36, 36);
        document.newPage();

        for (int i = 0; i < 40; i++) {
            p = new Paragraph("TEST");
            p.add(tab1);
            p.add(new Chunk(String.valueOf(i)));
            p.add(tab2);
            p.add(new Chunk(String.valueOf(i * 2)));
            p.add(tab3);
            p.add(new Chunk(SeparatedWords2.WORDS[39 - i]));
            p.add(tab4);
            p.add(new Chunk(String.valueOf(i * 4)));
            p.add(tab5);
            p.add(new Chunk(SeparatedWords2.WORDS[i]));
            document.add(p);
        }
        document.close();
    } catch (Exception de) {
        de.printStackTrace();
    }
}

From source file:questions.separators.TabbedWords2.java

public static void main(String[] args) {
    Document document = new Document();
    try {//from www. jav a  2s. c  om
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(RESULT));
        document.open();

        Paragraph p;
        Chunk tab1 = new Chunk(new VerticalPositionMark(), 100, true);
        Chunk tab2 = new Chunk(new LineSeparator(), 120, true);
        Chunk tab3 = new Chunk(new DottedLineSeparator(), 200, true);
        Chunk tab4 = new Chunk(new VerticalPositionMark(), 240, true);
        Chunk tab5 = new Chunk(new VerticalPositionMark(), 300, true);

        PdfContentByte canvas = writer.getDirectContent();
        ColumnText column = new ColumnText(canvas);
        for (int i = 0; i < 40; i++) {
            p = new Paragraph("TEST");
            p.add(tab1);
            p.add(new Chunk(String.valueOf(i)));
            p.add(tab2);
            p.add(new Chunk(String.valueOf(i * 2)));
            p.add(tab3);
            p.add(new Chunk(SeparatedWords2.WORDS[39 - i]));
            p.add(tab4);
            p.add(new Chunk(String.valueOf(i * 4)));
            p.add(tab5);
            p.add(new Chunk(SeparatedWords2.WORDS[i]));
            column.addElement(p);
        }
        column.setSimpleColumn(60, 36, 400, 806);
        canvas.moveTo(60, 36);
        canvas.lineTo(60, 806);
        canvas.moveTo(160, 36);
        canvas.lineTo(160, 806);
        canvas.moveTo(180, 36);
        canvas.lineTo(180, 806);
        canvas.moveTo(260, 36);
        canvas.lineTo(260, 806);
        canvas.moveTo(300, 36);
        canvas.lineTo(300, 806);
        canvas.moveTo(360, 36);
        canvas.lineTo(360, 806);
        canvas.moveTo(400, 36);
        canvas.lineTo(400, 806);
        canvas.stroke();
        column.go();

        document.setMargins(60, 195, 36, 36);
        document.newPage();

        canvas.moveTo(document.left(), document.bottom());
        canvas.lineTo(document.left(), document.top());
        canvas.moveTo(document.right(), document.bottom());
        canvas.lineTo(document.right(), document.top());
        canvas.stroke();
        for (int i = 0; i < 40; i++) {
            p = new Paragraph("TEST");
            p.add(tab1);
            p.add(new Chunk(String.valueOf(i)));
            p.add(tab2);
            p.add(new Chunk(String.valueOf(i * 2)));
            p.add(tab3);
            p.add(new Chunk(SeparatedWords2.WORDS[39 - i]));
            p.add(tab4);
            p.add(new Chunk(String.valueOf(i * 4)));
            p.add(tab5);
            p.add(new Chunk(SeparatedWords2.WORDS[i]));
            document.add(p);
        }
        document.close();
    } catch (Exception de) {
        de.printStackTrace();
    }
}

From source file:questions.separators.TOCExample.java

public static void main(String[] args) {
    Document document = new Document();
    try {/* w  w  w  .  ja v a2s  .  co m*/
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(RESULT));
        document.open();

        Chunk tab0 = new Chunk(new VerticalPositionMark(), 0, true);
        Chunk tab1 = new Chunk(new LineSeparator(), 40, true);
        Chunk tab2 = new Chunk(new DottedLineSeparator(), 120, true);

        Paragraph p1 = new Paragraph();
        p1.add(new Chunk("1"));
        p1.add(tab1);
        p1.add(new Chunk("Chapter 1"));
        p1.add(tab2);
        p1.add(new Chunk("p1"));
        Paragraph p2 = new Paragraph();
        p2.add(tab1);
        p2.add(new Chunk("Introduction"));
        p2.add(tab2);
        p2.add(new Chunk("p2"));
        Paragraph p3 = new Paragraph();
        p3.add(tab1);
        p3.add(new Chunk("Let us test the tab functionality in iText with a long line"));
        p3.add(tab2);
        p3.add(new Chunk("p3"));
        Paragraph p4 = new Paragraph();
        p4.add(tab1);
        p4.add(new Chunk("test"));
        p4.add(tab2);
        Paragraph p5 = new Paragraph();
        p5.add(new Chunk("2"));
        p5.add(tab1);
        p5.add(tab2);
        Paragraph p6 = new Paragraph();
        p6.add(tab1);
        p6.add(tab2);
        p6.add(new Chunk("p4"));
        Paragraph p7 = new Paragraph();
        p7.add(tab1);
        p7.add(tab2);
        Paragraph p8 = new Paragraph();
        p8.add(new Chunk("3"));
        p8.add(tab1);
        p8.add(new Chunk("Chapter 3"));
        p8.add(tab2);
        p8.add(new Chunk("p5"));
        p8.add(tab0);
        p8.add(new Chunk("4"));
        p8.add(tab1);
        p8.add(new Chunk("Chapter 4 - the final chapter"));
        p8.add(tab2);
        p8.add(new Chunk("p6"));

        document.add(p1);
        document.add(p2);
        document.add(p3);
        document.add(p4);
        document.add(p5);
        document.add(p6);
        document.add(p7);
        document.add(p8);

        PdfContentByte canvas = writer.getDirectContent();
        ColumnText column = new ColumnText(canvas);
        column.addElement(p1);
        column.addElement(p2);
        column.addElement(p3);
        column.addElement(p4);
        column.addElement(p5);
        column.addElement(p6);
        column.addElement(p7);
        column.addElement(p8);
        column.setSimpleColumn(36, 500, 200, 600);
        column.go();
        column.setSimpleColumn(260, 500, 460, 600);
        column.go();

        document.close();
    } catch (Exception de) {
        de.printStackTrace();
    }
}

From source file:questions.tables.RotateCell.java

public static void main(String[] args) {
    Document document = new Document(PageSize.A4);
    try {/*from  w ww  .java 2s  . com*/
        PdfWriter.getInstance(document, new FileOutputStream(RESULT));
        document.open();
        Paragraph paragraphA = new Paragraph();
        paragraphA.add(new Phrase("TestA"));
        Paragraph paragraphB = new Paragraph();
        paragraphB.add(new Phrase("\u00a0"));
        Paragraph paragraphC = new Paragraph();
        paragraphC.add(new Phrase("TestB"));

        PdfPTable table = new PdfPTable(1);
        PdfPCell cell = new PdfPCell();
        cell.addElement(paragraphA);
        cell.addElement(paragraphB);
        cell.addElement(paragraphC);
        cell.setRotation(90);
        table.addCell(cell);

        document.add(table);
    } catch (DocumentException de) {
        System.err.println(de.getMessage());
    } catch (IOException ioe) {
        System.err.println(ioe.getMessage());
    }
    document.close();
}

From source file:rtf.shapes.RTFShapeTextWrap.java

/**
 * @param args/*from   w w w. j a va2 s . co  m*/
 */
public static void main(String[] args) {
    Document document = new Document();

    try {
        RtfWriter2.getInstance(document, new FileOutputStream(resultsPath + outFile));
        document.open();
        Image logo = Image.getInstance(resourcePath + inFile1);

        Paragraph p = new Paragraph();
        Chunk c = new Chunk();
        c.append(
                "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. "
                        + "This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. ");

        RtfShapePosition position = new RtfShapePosition(2000, 6000, 10500, 4500);
        RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE, position);
        shape.setWrapping(RtfShape.SHAPE_WRAP_LEFT);
        shape.setProperty(new RtfShapeProperty(RtfShapeProperty.PROPERTY_IMAGE, logo));

        p.add(shape);
        p.add(c);
        document.add(p);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (BadElementException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (DocumentException e) {
        e.printStackTrace();
    }
    document.close();
}

From source file:s2s.report.Report.java

License:GNU General Public License

public void writeParagrafo(String strName) throws BadElementException, DocumentException {
    Paragraph pr = new Paragraph("", REPORT_SETTINGS.ftParagraph2);
    //pr.setIndentationLeft(10f);

    Paragraph pr1 = new Paragraph(strName, REPORT_SETTINGS.ftTableHeader);
    pr1.setIndentationLeft(10f);/*  w w w .j ava 2 s  .c  o m*/

    Cell cl = new Cell(pr1);
    cl.setBackgroundColor(REPORT_SETTINGS.clTableHeader);

    CenterMiddleTable tbl = new CenterMiddleTable(1);
    tbl.toLeft();
    tbl.addCell(cl);

    pr.add(tbl);
    m_document.add(pr);
}

From source file:servlets.InvioServlet.java

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    servletContext = getServletContext();

    HttpSession session = request.getSession(true);
    int idpre = Integer.parseInt(request.getParameter("idpre"));
    System.out.println(idpre);/*from   w  ww  .  j  av a2s .c  o  m*/
    Prenotazione preno = null;
    try {
        preno = manager.getPrenotazione(idpre);
    } catch (SQLException ex) {
        Logger.getLogger(InvioServlet.class.getName()).log(Level.SEVERE, null, ex);
    }

    //int id=preno.getId_prenotazione();
    double prezzo_pagato = preno.getId_prezzo();
    int posto = preno.getId_posto();
    int spettacolo = preno.getId_spettacolo();
    Date data = preno.getData_ora_prenotazione();
    String email;
    email = preno.getEmail();
    Date data_spettacolo = preno.getData_ora_spettacolo();
    String film = preno.getTitolo();

    //creo il pdf per la prenotazione
    Document document = new Document();
    try {
        PdfWriter.getInstance(document, new FileOutputStream(servletContext.getRealPath("/") + "ticket.pdf"));
        System.out.println("Creazione file riuscita");
    } catch (DocumentException ex) {
        request.setAttribute("errorMessage", "Errore nella generazione del pdf dei biglietti. "
                + "I tuoi biglietti sono comunque stati salvati,  necessario contattare l'admin");
        RequestDispatcher rd = request.getRequestDispatcher("/errorPage.jsp");
        rd.forward(request, response);
    }
    document.open();

    //creo il paragrafo per il tiolo della pagina
    Paragraph p = new Paragraph("Biglietto n " + idpre);
    p.setAlignment(Element.ALIGN_CENTER);
    try {
        document.add(p);
        System.out.println("Scrittura file riuscita");
    } catch (DocumentException ex) {
        request.setAttribute("errorMessage", "Errore nella generazione del pdf dei biglietti.");
        RequestDispatcher rd = request.getRequestDispatcher("/errorPage.jsp");
        rd.forward(request, response);
    }

    //creo il paragrafo per i dati del biglietto
    p = new Paragraph("");
    p.setAlignment(Element.ALIGN_LEFT);
    p.add("Biglietto: " + idpre + "\n");
    p.add("Utente: " + email + "\n");
    p.add("Prezzo pagato: " + prezzo_pagato + "\n");
    p.add("Numero posto: " + posto + "\n");
    p.add("Spettacolo: " + spettacolo + "\n");
    p.add("Data: " + data + "\n");
    p.add("Data spettacolo: " + data_spettacolo + "\n");
    p.add("Film: " + film + "\n");

    try {
        document.add(p);
        System.out.println("Scrittura file riuscita");
    } catch (DocumentException ex) {
        request.setAttribute("errorMessage", "Errore nella generazione del pdf dei biglietti. "
                + "I tuoi biglietti sono comunque stati salvati,  necessario contattare l'admin");
        RequestDispatcher rd = request.getRequestDispatcher("/errorPage.jsp");
        rd.forward(request, response);
    }

    //creo il qrcode e lo aggiungo alla pagina
    Image image = null;
    File file;
    p = new Paragraph("");
    file = QRCode
            .from("utente:" + email + "\n" + "prezzo:" + prezzo_pagato + "\n" + "numero posto:" + posto + "\n"
                    + "spettacolo:" + spettacolo + "\n" + "data prenotazione:" + data + "\n"
                    + "data spettacolo:" + data_spettacolo + "\n" + "film:" + film)
            .to(ImageType.JPG).withSize(100, 100).file();
    try {
        image = Image.getInstance(file.getAbsolutePath());
    } catch (BadElementException | MalformedURLException ex) {
        // Logger.getLogger(SendTicket.class.getName()).log(Level.SEVERE, null, ex);
    }
    System.out.println(file.toString());
    try {
        document.add(image);
    } catch (DocumentException ex) {
        request.setAttribute("errorMessage", "Errore nella generazione del pdf dei biglietti. "
                + "I tuoi biglietti sono comunque stati salvati,  necessario contattare l'admin");
        RequestDispatcher rd = request.getRequestDispatcher("/errorPage.jsp");
        rd.forward(request, response);
    }

    try {
        document.add(p);
        document.newPage();
        System.out.println("Scrittura file riuscita");
    } catch (DocumentException ex) {
        request.setAttribute("errorMessage", "Errore nella generazione del pdf dei biglietti. "
                + "I tuoi biglietti sono comunque stati salvati,  necessario contattare l'admin");
        RequestDispatcher rd = request.getRequestDispatcher("/errorPage.jsp");
        rd.forward(request, response);
    }

    document.close();

    try {
        //invio la mail per la conferma della prenotazione con allegato il pdf
        Email.ticketEmail("smtp.gmail.com", "587", "cinemangiare@gmail.com", "Cinemangiaredb", email,
                "Conferma acquisto biglietti",
                "Gentile cliente," + "\n" + "le confermiamo la prenotazione presso il nostro cinema." + "\n"
                        + "In allegato trover il file pdf da stampare contenente i biglietti",
                servletContext.getRealPath("/") + "ticket.pdf");
    } catch (MessagingException ex) {
        request.setAttribute("errorMessage", "Errore nella generazione del pdf dei biglietti. "
                + "I tuoi biglietti sono comunque stati salvati,  necessario contattare l'admin");
        RequestDispatcher rd = request.getRequestDispatcher("/errorPage.jsp");
        rd.forward(request, response);
    }

    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/final.jsp");
    dispatcher.forward(request, response);
}

From source file:servlets.PrenotazioneServlet.java

private void invioBiglietto(ArrayList<Integer> id_prenotazione)
        throws DocumentException, FileNotFoundException {

    servletContext = getServletContext();

    ArrayList<Double> prezzo_pagato = new ArrayList<>();
    ArrayList<Integer> posto = new ArrayList<>();
    ArrayList<Integer> spettacolo = new ArrayList<>();
    ArrayList<Date> data = new ArrayList<>();
    ArrayList<String> emails = new ArrayList<>();
    ArrayList<String> titolo = new ArrayList<>();
    ArrayList<Date> data_spettacolo = new ArrayList<>();
    ArrayList<Integer> sala = new ArrayList<>();

    Prenotazione preno = null;/*from ww w .  j  a  v  a  2 s .co  m*/

    try {
        for (int i = 0; i < id_prenotazione.size(); i++) {
            preno = manager.getPrenotazione(id_prenotazione.get(i));
            System.out.println(id_prenotazione.get(i));

            prezzo_pagato.add(preno.getId_prezzo());
            posto.add(preno.getId_posto() - ((preno.getSala() - 1) * 50));
            spettacolo.add(preno.getId_spettacolo());
            data.add(preno.getData_ora_prenotazione());
            emails.add(preno.getEmail());
            titolo.add(preno.getTitolo());
            data_spettacolo.add(preno.getData_ora_spettacolo());
            sala.add(preno.getSala());
        }

    } catch (SQLException ex) {
        Logger.getLogger(InvioServlet.class.getName()).log(Level.SEVERE, null, ex);
    }

    //int id=preno.getId_prenotazione();
    //creo il pdf per la prenotazione
    Document document = new Document();

    PdfWriter.getInstance(document, new FileOutputStream(servletContext.getRealPath("/") + "ticket.pdf"));
    System.out.println("Creazione file riuscita");

    document.open();

    //creo il paragrafo per il tiolo della pagina      
    for (int i = 0; i < id_prenotazione.size(); i++) {
        Paragraph p = new Paragraph("Biglietto n " + id_prenotazione.get(i));

        p.setAlignment(Element.ALIGN_CENTER);

        try {
            document.add(p);
            System.out.println("Scrittura file riuscita");
        } catch (DocumentException ex) {

        }

        //creo il paragrafo per i dati del biglietto
        p = new Paragraph("");
        p.setAlignment(Element.ALIGN_LEFT);
        p.add("Biglietto: " + id_prenotazione.get(i) + "\n");
        p.add("Utente: " + emails.get(i) + "\n");
        p.add("Prezzo pagato: " + prezzo_pagato.get(i) + "\n");
        p.add("Numero posto: " + posto.get(i) + "\n");
        p.add("Spettacolo: " + spettacolo.get(i) + "\n");
        p.add("Data: " + data.get(i) + "\n");
        p.add("Film: " + titolo.get(i) + "\n");
        p.add("Data spettacolo: " + data_spettacolo.get(i) + "\n");
        p.add("Sala: " + sala.get(i) + "\n");

        System.out.println("INFO INFO INFO" + id_prenotazione.get(i) + " " + emails.get(i) + " "
                + prezzo_pagato.get(i) + " " + posto.get(i) + " " + spettacolo.get(i) + " " + data.get(i) + " "
                + "FINE FINE FINE");

        try {
            document.add(p);
            System.out.println("Scrittura file riuscita");
        } catch (DocumentException ex) {

        }
    }
    //creo il qrcode e lo aggiungo alla pagina
    Image image = null;
    File file;
    Paragraph p = new Paragraph("");
    file = QRCode.from("Email:" + email + "\n" + "Prezzo:" + prezzo_pagato + "\n" + "Numero posto:" + posto
            + "\n" + "Spettacolo:" + spettacolo.get(0) + "\n" + "Data:" + data.get(0) + "\n" + "Film: "
            + titolo.get(0) + "\n" + "Data spettacolo: " + data_spettacolo.get(0) + "\n" + "Sala: "
            + sala.get(0)).to(ImageType.JPG).withSize(300, 300).file();
    try {
        image = Image.getInstance(file.getAbsolutePath());
    } catch (BadElementException | MalformedURLException ex) {
        // Logger.getLogger(SendTicket.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(PrenotazioneServlet.class.getName()).log(Level.SEVERE, null, ex);
    }
    System.out.println(file.toString());
    try {
        document.add(image);
    } catch (DocumentException ex) {

    }

    try {
        document.add(p);
        document.newPage();
        System.out.println("Scrittura file riuscita");
    } catch (DocumentException ex) {

    }

    document.close();

    try {

        //invio la mail per la conferma della prenotazione con allegato il pdf
        Email.ticketEmail("smtp.gmail.com", "587", "cinemangiare@gmail.com", "Cinemangiaredb", email,
                "Conferma acquisto biglietti",
                "Gentile cliente," + "\n" + "le confermiamo la prenotazione presso il nostro cinema." + "\n"
                        + "In allegato trover il file pdf da stampare contenente i biglietti",
                servletContext.getRealPath("/") + "ticket.pdf");
    } catch (Exception ex) {
        System.out.println("logan");
    }
}