Examples of LwgPdfPCell


Examples of com.lowagie.text.pdf.LwgPdfPCell

      CellEvents event = new CellEvents();
      LwgImage im = LwgImage.getInstance("otsoe.jpg");
      im.setRotationDegrees(30);
      LwgPdfPTable table = new LwgPdfPTable(4);
      table.add("text 1");
      LwgPdfPCell cell = new LwgPdfPCell(im, true);
      cell.setCellEvent(event);
      table.add(cell);
      table.add("text 3");
      im.setRotationDegrees(0);
      table.add(im);
      table.setTotalWidth(300);
View Full Code Here

Examples of com.lowagie.text.pdf.LwgPdfPCell

      // step 4
      float[] columnDefinitionSize = { 33.33F, 33.33F, 33.33F };

      float pos = height / 2;
      LwgPdfPTable table = null;
      LwgPdfPCell cell = null;

      table = new LwgPdfPTable(columnDefinitionSize);
      table.getDefaultCell().setBorder(0);
      table.setHorizontalAlignment(0);
      table.setTotalWidth(width - 72);
      table.setLockedWidth(true);

      cell = new LwgPdfPCell(new LwgPhrase("Table added with document.add()"));
      cell.setColspan(columnDefinitionSize.length);
      table.add(cell);
      table.add(new LwgPhrase("Louis Pasteur", font8));
      table.add(new LwgPhrase("Albert Einstein", font8));
      table.add(new LwgPhrase("Isaac Newton", font8));
      table.add(new LwgPhrase("8, Rabic street", font8));
      table.add(new LwgPhrase("2 Photons Avenue", font8));
      table.add(new LwgPhrase("32 Gravitation Court", font8));
      table.add(new LwgPhrase("39100 Dole France", font8));
      table.add(new LwgPhrase("12345 Ulm Germany", font8));
      table.add(new LwgPhrase("45789 Cambridge  England", font8));
     
      document.add(table);
     
      table = new LwgPdfPTable(columnDefinitionSize);
      table.getDefaultCell().setBorder(0);
      table.setHorizontalAlignment(0);
      table.setTotalWidth(width - 72);
      table.setLockedWidth(true);

      cell = new LwgPdfPCell(new LwgPhrase("Table added with writeSelectedRows"));
      cell.setColspan(columnDefinitionSize.length);
      table.add(cell);
      table.add(new LwgPhrase("Louis Pasteur", font8));
      table.add(new LwgPhrase("Albert Einstein", font8));
      table.add(new LwgPhrase("Isaac Newton", font8));
      table.add(new LwgPhrase("8, Rabic street", font8));
View Full Code Here

Examples of com.lowagie.text.pdf.LwgPdfPCell

            img.setRotationDegrees(90);
            LwgPdfPTable table = new LwgPdfPTable(3);
            table.setWidthPercentage(100);
            table.getDefaultCell().setHorizontalAlignment(LwgElement.ALIGN_CENTER);
            table.getDefaultCell().setVerticalAlignment(LwgElement.ALIGN_MIDDLE);
            LwgPdfPCell cell = new LwgPdfPCell(img);
            cell.setPadding(4);
            cell.setBackgroundColor(new Color(0, 0, 255));
            cell.setHorizontalAlignment(LwgElement.ALIGN_CENTER);
            table.add("I see a template on my right");
            table.add(cell);
            table.add("I see a template on my left");
            table.add(cell);
            table.add("I see a template everywhere");
View Full Code Here

Examples of com.lowagie.text.pdf.LwgPdfPCell

          Color.BLACK);

      LwgPdfPTable table = new LwgPdfPTable(2);
      table.setWidthPercentage(100f);

      LwgPdfPCell h1 = new LwgPdfPCell(new Paragraph("Header 1", font));
      LwgPdfPCell h2 = new LwgPdfPCell(new Paragraph("Header 2", font));
      table.setHeaderRows(1);
      table.add(h1);
      table.add(h2);
      LwgPdfPCell cell;
      for (int row = 1; row <= 2000; row++) {
        if (row % fragmentsize == fragmentsize - 1) {
          document.add(table);
          table.deleteBodyRows();
          table.setSkipFirstHeader(true);
        }
        cell = new LwgPdfPCell(new Paragraph(String.valueOf(row), font));
        table.add(cell);
        cell = new LwgPdfPCell(
            new Paragraph(
                "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla mauris nibh, ultricies nec, adipiscing eget.",
                font));
        table.add(cell);
      }
View Full Code Here

Examples of com.lowagie.text.pdf.LwgPdfPCell

    private static LwgPdfPCell makeCell(String text, int vAlignment, int hAlignment, LwgFont font, float leading, float padding, LwgRectangle borders, boolean ascender, boolean descender) {
        Paragraph p = new Paragraph(text, font);
        p.setLeading(leading);

        LwgPdfPCell cell = new LwgPdfPCell(p);
        cell.setLeading(leading, 0);
        cell.setVerticalAlignment(vAlignment);
        cell.setHorizontalAlignment(hAlignment);
        cell.cloneNonPositionParameters(borders);
        cell.setUseAscender(ascender);
        cell.setUseDescender(descender);
        cell.setUseBorderPadding(true);
        cell.setPadding(padding);
        return cell;
    }
View Full Code Here

Examples of com.lowagie.text.pdf.LwgPdfPCell

            String atext = "\u062a\u0635\u0628\u062d ";
            LwgPdfPTable table = new LwgPdfPTable(5);
            table.setWidthPercentage(100);
            table.setRunDirection(PdfWriter.RUN_DIRECTION_NO_BIDI);
            for (int k = 0; k < 5; ++k) {
                LwgPdfPCell cell = new LwgPdfPCell(new LwgPhrase(10, atext + k, f2));
                if (k == 2) {
                    cell.setColspan(2);
                    ++k;
                }
                table.add(cell);
            }
            table.setRunDirection(PdfWriter.RUN_DIRECTION_LTR);
            for (int k = 0; k < 5; ++k) {
                LwgPdfPCell cell = new LwgPdfPCell(new LwgPhrase(10, atext + k, f2));
                if (k == 2) {
                    cell.setColspan(2);
                    ++k;
                }
                table.add(cell);
            }
            table.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
            for (int k = 0; k < 5; ++k) {
                LwgPdfPCell cell = new LwgPdfPCell(new LwgPhrase(10, atext + k, f2));
                if (k == 2) {
                    cell.setColspan(2);
                    ++k;
                }
                table.add(cell);
            }
            document.add(table);
View Full Code Here

Examples of com.lowagie.text.pdf.LwgPdfPCell

      // step3
      document.open();
      // step4
      LwgPdfPTable table = new LwgPdfPTable(2);
      table.setExtendLastRow(true);
      LwgPdfPCell cell;
     
      // wrap / nowrap
      cell = new LwgPdfPCell(new Paragraph("blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah"));
      table.add("wrap");
      cell.setNoWrap(false);
      table.add(cell);
      table.add("no wrap");
      cell.setNoWrap(true);
      table.add(cell);
     
      // height
      cell = new LwgPdfPCell(new Paragraph("1. blah blah\n2. blah blah blah\n3. blah blah\n4. blah blah blah\n5. blah blah\n6. blah blah blah\n7. blah blah\n8. blah blah blah"));
      table.add("height");
      table.add(cell);
      table.add("fixed height");
      cell.setFixedHeight(50f);
      table.add(cell);
      table.add("minimum height");
      cell = new LwgPdfPCell(new Paragraph("x"));
      cell.setMinimumHeight(50f);
      table.add(cell);
      table.add("extend last row");
      cell = new LwgPdfPCell(new Paragraph("almost no content, but the row is extended"));
      table.add(cell);
      document.add(table);
    } catch (Exception de) {
      de.printStackTrace();
    }
View Full Code Here

Examples of com.lowagie.text.pdf.LwgPdfPCell

      // step 3: we open the document
      document.open();

      LwgPdfPTable table = new LwgPdfPTable(3);
      LwgPdfPCell cell = new LwgPdfPCell(new Paragraph("header with colspan 3"));
      cell.setColspan(3);
      table.add(cell);
      table.add("1.1");
      table.add("2.1");
      table.add("3.1");
      table.getDefaultCell().setGrayFill(0.8f);
View Full Code Here

Examples of com.lowagie.text.pdf.LwgPdfPCell

      // step 3: we open the document
      document.open();

      LwgPdfPTable table = new LwgPdfPTable(3);
      LwgPdfPCell cell = new LwgPdfPCell(new Paragraph("header with colspan 3"));
      cell.setColspan(3);
      table.add(cell);
      table.add("1.1");
      table.add("2.1");
      table.add("3.1");
      table.add("1.2");
      table.add("2.2");
      table.add("3.2");
      cell = new LwgPdfPCell(new Paragraph("cell test1"));
      cell.setBorderColor(new Color(255, 0, 0));
      table.add(cell);
      cell = new LwgPdfPCell(new Paragraph("cell test2"));
      cell.setColspan(2);
      cell.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0));
      table.add(cell);
      document.add(table);
    } catch (DocumentException de) {
      System.err.println(de.getMessage());
    } catch (IOException ioe) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.