Package com.itextpdf.text

Examples of com.itextpdf.text.Paragraph


      document.close();
    }
  }

  private void addTitle(Document document) throws DocumentException {
    Paragraph title = new Paragraph(exportConf.getFileName());
    title.add(new Paragraph(" ")); // empty line
    title.setAlignment(Element.ALIGN_CENTER);
    document.add(title);
  }
View Full Code Here


          HeaderFooter event = new HeaderFooter();
          writer.setBoxSize("art", new Rectangle(36, 54, 559, 788));
          writer.setPageEvent(event);
         document.open();
         
      Paragraph p=new Paragraph();
      for (int i=0; i<=1000; i++){
      p.add("dnfkjnsdjkfjknsdkjfnknsdkfjbsdkjfs");}
      document.add(p);
     
          document.close();
       }
View Full Code Here

  public PdfPTable createTable(String airport) {

    // Creation of PdfTable with 4 columns
    final PdfPTable table = new PdfPTable(4);

    final PdfPCell cell1 = new PdfPCell(new Paragraph("Service", BFONT));
    cell1.setGrayFill(0.3f);
    final PdfPCell cell2 = new PdfPCell(new Paragraph("Thème", BFONT));
    cell2.setGrayFill(0.3f);
    final PdfPCell cell3 = new PdfPCell(
        new Paragraph("Observations", BFONT));
    cell3.setGrayFill(0.3f);
    final PdfPCell cell4 = new PdfPCell(new Paragraph("Action(s)", BFONT));
    cell4.setGrayFill(0.3f);

    table.addCell(cell1);
    table.addCell(cell2);
    table.addCell(cell3);
View Full Code Here

   *
   * @param paragraph, number
   */
  public void ajouterLigneVide(Paragraph paragraph, int number) {
    for (int i = 0; i < number; i++) {
      paragraph.add(new Paragraph(" "));
    }
  }
View Full Code Here

   * @param airport
   */
  public int generate(String airport) {

    Document doc = null;
    Paragraph p1 = new Paragraph(
        "                             A   Monsieur le directeur de l'aéroport",
        CATFONT);
    ajouterLigneVide(p1, 2);
    Paragraph p2 = new Paragraph(
        "Objet : Signature à apposer sur Procés-Verbal", CATFONT);
    ajouterLigneVide(p2, 2);
    Paragraph p3 = new Paragraph("Monsieur,", CATFONT);
    ajouterLigneVide(p3, 1);
    Paragraph p4 = new Paragraph(
        "Nous avons élaboré le rapport des actions à faire suites aux réclamations que vous avez reçu dans votre aéroport. ",
        CATFONT);
    ajouterLigneVide(p4, 1);
    Paragraph p5 = new Paragraph(
        "Comme, nous vous remercions aux efforts que vous fournissez pour collaborer à ce travail. Nous insistons sur le faite de nous envoyer un rapport détaillé englobant toutes les Actions Entreprises Parmi celles incluent dans le tableau suivant :",
        CATFONT);
    ajouterLigneVide(p5, 2);
    Paragraph p6 = new Paragraph(
        "Nous vous prions d'agréer, Monsieur, nos salutations distinguées.",
        CATFONT);

    SimpleDateFormat formatter = new SimpleDateFormat("dd_MM_yyyy");
    String file = "/home/matrix/Desktop/pvs/PV_" + formatter.format(new Date())
        + "_" + airport + ".pdf";

    try {

      doc = new Document();

      PdfWriter writer = PdfWriter.getInstance(doc, new FileOutputStream(
          file));
      writer.setPdfVersion(PdfWriter.PDF_VERSION_1_6);

      // opening the document for writing
      doc.open();

      Image _logo = Image
          .getInstance("/home/matrix/apps/workspace/reclaadmin/WebContent/VAADIN/themes/reindeer/layouts/images/logo.gif");
      _logo.setAlignment(1);
      _logo.scalePercent(50);

      Image logo = Image
          .getInstance("/home/matrix/apps/workspace/reclaadmin/WebContent/VAADIN/themes/reindeer/layouts/images/slogon.gif");
      logo.setAlignment(1);
      logo.scalePercent(50);

      Paragraph p0 = new Paragraph();
      p0.add(_logo);
      p0.add(logo);

      ajouterLigneVide(p0, 3);

      doc.add(p0);
      doc.add(p1);
View Full Code Here

            logo.scalePercent(50);
           
            document.add(_logo);
            document.add(logo);
           
            document.add(new Paragraph("--Header--"));
           
        } catch (Exception e) {
            e.printStackTrace();
        }
       
View Full Code Here

      document = new Document(PageSize.A4, 10, 10, 50, 50);
      PdfWriter instance = PdfWriter.getInstance(document, os);
      document.open();

      Paragraph paragraph = new Paragraph("Zestawienie czasu pracy pracownika za " + date
          + " - " + person, f);
      paragraph.setAlignment(Element.ALIGN_CENTER);
      document.add(paragraph);
      addEmptyLine(document, 2);
      PdfPTable table = new PdfPTable(5);

      Phrase phrase = new Phrase("Dzień miesiąca", f);
      PdfPCell c1 = new PdfPCell(phrase);
      c1.setHorizontalAlignment(Element.ALIGN_CENTER);
      table.addCell(c1);

      c1 = new PdfPCell(new Phrase("Czas pracy\u0144", f));
      c1.setHorizontalAlignment(Element.ALIGN_CENTER);
      table.addCell(c1);

      c1 = new PdfPCell(new Phrase("Program"));
      c1.setHorizontalAlignment(Element.ALIGN_CENTER);
      table.addCell(c1);

      c1 = new PdfPCell(new Phrase("Czas nieobecności", f));
      c1.setHorizontalAlignment(Element.ALIGN_CENTER);
      table.addCell(c1);

      c1 = new PdfPCell(new Phrase("Przyczyna nieobecność", f));
      c1.setHorizontalAlignment(Element.ALIGN_CENTER);
      table.addCell(c1);

      table.setHeaderRows(1);

      for (Day day : days) {
        PdfPCell cell = new PdfPCell(new Phrase(getValue(day.getDay()), f));
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        table.addCell(cell);

        cell = new PdfPCell(new Phrase(getValue(day.getWorkTime()), f));
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        table.addCell(cell);

        cell = new PdfPCell(new Phrase(getValue(day.getProgram()), f));
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        table.addCell(cell);

        cell = new PdfPCell(new Phrase(getValue(day.getAbsenceTime()), f));
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        table.addCell(cell);

        cell = new PdfPCell(new Phrase(getValue(day.getAbsenceReason()), f));
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        table.addCell(cell);

      }
      document.add(table);

      addEmptyLine(document, 3);
      Paragraph paragraph2 = new Paragraph("Podpis pracownika");
      paragraph2.setAlignment(Element.ALIGN_CENTER);
      document.add(paragraph2);
      Paragraph paragraph3 = new Paragraph("...........................................");
      paragraph3.setAlignment(Element.ALIGN_CENTER);
      document.add(paragraph3);
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
      if (document != null) {
View Full Code Here

    }
  }

  private static void addEmptyLine(final Document document, final int number) throws Exception {
    for (int i = 0; i < number; i++) {
      document.add(new Paragraph(" "));
    }
  }
View Full Code Here

   * Adds a new line to the currentParagraph.
   * @since 5.0.6
   */
  public void newLine() {
    if (currentParagraph == null) {
      currentParagraph = new Paragraph();
    }
    currentParagraph.add(createChunk("\n"));
  }
View Full Code Here

   * a new span.
   * @since 5.0.6
   */
  public void flushContent() {
    pushToStack(currentParagraph);
    currentParagraph = new Paragraph();
  }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.Paragraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.