Package com.lowagie.text

Examples of com.lowagie.text.LwgDocument.open()


    {
        LwgDocument document = new LwgDocument(LwgPageSize.A4, 50, 50, 70, 70);
        try {
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("endpage.pdf"));
            writer.setPageEvent(new EndPage());
            document.open();
            String text = "Lots of text. ";
            for (int k = 0; k < 10; ++k)
                text += text;
            document.add(new Paragraph(text));
            document.close();
View Full Code Here


        LwgDocument document = new LwgDocument(LwgPageSize.A4, 50, 50, 50, 50);
        try {
            // step 2: creation of a writer
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("groups.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: content
            PdfContentByte cb = writer.getDirectContent();
            float gap = (document.getPageSize().getWidth() - 400) / 3;
           
            pictureBackdrop(gap, 500, cb);
View Full Code Here

            // we create a writer that listens to the document
            // and directs a PDF-stream to a file
            PdfWriter.getInstance(document, new FileOutputStream("version.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4:
            document.add(new Paragraph("This page was made using " + LwgDocument.getVersion()));
        }
        catch(DocumentException de) {
View Full Code Here

            // we create a writer that listens to the document
            // and directs a PDF-stream to a file
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("patterns.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4: we grab the ContentByte and do some stuff with it
            PdfContentByte cb = writer.getDirectContent();
           
            BaseFont bf = BaseFont.createFont("Times-Roman", "winansi", false);
View Full Code Here

    try {
      // step2
      PdfWriter.getInstance(document,
          new GfrFileOutputStream("com.lowagie.examples.objects.tables.CellPaddingLeading.pdf"));
      // step3
      document.open();
      // step4
      LwgPdfPTable table = new LwgPdfPTable(2);
      LwgPdfPCell cell;
      Paragraph p = new Paragraph("Quick brown fox jumps over the lazy dog. Quick brown fox jumps over the lazy dog.");
      table.add("default");
View Full Code Here

    try {
      // step2
      PdfWriter.getInstance(document,
          new GfrFileOutputStream("com.lowagie.examples.objects.tables.NestedTables.pdf"));
      // step3
      document.open();
      // step4
            LwgPdfPTable table = new LwgPdfPTable(4);
            LwgPdfPTable nested1 = new LwgPdfPTable(2);
            nested1.add("1.1");
            nested1.add("1.2");
View Full Code Here

      PdfWriter.getInstance(document3,
          new GfrFileOutputStream("com.lowagie.examples.objects.tables.SplitRows_OmitRows.pdf"));
      // step3
      document1.open();
      document2.open();
      document3.open();
      // step4
      String text = "Quick brown fox jumps over the lazy dog. ";
      for (int i = 0; i < 5; i++) text += text;
      LwgPdfPTable table = new LwgPdfPTable(2);
      LwgPdfPCell largeCell;
View Full Code Here

    try {
      // step2
      PdfWriter.getInstance(document,
          new GfrFileOutputStream("com.lowagie.examples.objects.tables.CellWidths.pdf"));
      // step3
      document.open();
      // step4
      float[] widths = {0.1f, 0.1f, 0.05f, 0.75f};
      LwgPdfPTable table = new LwgPdfPTable(widths);
      table.add("10%");
      table.add("10%");
View Full Code Here

           
            // step 2: creation of the writer-object
            PdfWriter.getInstance(document, new GfrFileOutputStream("com.lowagie.examples.fonts.UnicodeExample.pdf"));
           
            // step 3: we open the document
            document.open();
           
            // step 4: we add content to the document
            BaseFont bfComic = BaseFont.createFont("c:\\windows\\fonts\\comic.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
            LwgFont font = new LwgFont(bfComic, 12);
            String text1 = "This is the quite popular True Type font 'Comic'.";
View Full Code Here

      // we create a writer that listens to the document
      PdfWriter.getInstance(document, new FileOutputStream(
          "NegativeLeading.pdf"));

      // step 3: we open the document
      document.open();
      // step 4:
      document.add(new LwgPhrase(16, "\n\n\n"));
      document
          .add(new LwgPhrase(
              -16,
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.