Examples of LwgFont


Examples of com.lowagie.text.LwgFont

           
            // step 3: we open the document
            document.open();
           
            // step 4: we add content to the document
            LwgFont font0 = FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, 12);
            String text0 = "This is the quite popular built in font '" + BaseFont.HELVETICA + "'.";
            document.add(new Paragraph(text0, font0));
            LwgFont font1 = FontFactory.getFont("ComicSansMS", BaseFont.WINANSI, 12);
            String text1 = "This is the quite popular True Type font 'ComicSansMS'.";
            document.add(new Paragraph(text1, font1));
            LwgFont font2 = FontFactory.getFont("ComicSansMS-Bold", BaseFont.WINANSI, 12);
            String text2 = "This is the quite popular True Type font 'ComicSansMS-Bold'.";
            document.add(new Paragraph(text2, font2));
            LwgFont font3= FontFactory.getFont("MS-PGothic", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 12);
            String text3 = "\u5951\u7d04\u8005\u4f4f\u6240\u30e9\u30a4\u30f3\uff11";
            document.add(new Paragraph(text3, font3));
        BufferedWriter out = new BufferedWriter(new FileWriter("registered.txt"));
            out.write("These fonts were registered at the FontFactory:\r\n");
            for (Iterator i = FontFactory.getRegisteredFonts().iterator(); i.hasNext(); ) {
View Full Code Here

Examples of com.lowagie.text.LwgFont

      // step 3:
      writer.setViewerPreferences(PdfWriter.PageModeUseOC);
      document.open();
      // step 4:
      PdfContentByte cb = writer.getDirectContent();
      LwgPhrase explanation = new LwgPhrase("Layer grouping", new LwgFont(
          LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
      ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50,
          650, 0);
      PdfLayer l1 = new PdfLayer("Layer 1", writer);
      PdfLayer l2 = new PdfLayer("Layer 2", writer);
View Full Code Here

Examples of com.lowagie.text.LwgFont

            // step 3
            document.open();
            // step 4
            BaseFont bf = BaseFont.createFont("liz.otf", BaseFont.CP1252, true);
            String text = "Some text with the otf font LIZ.";
            document.add(new Paragraph(text, new LwgFont(bf, 14)));
        }
        catch (Exception de) {
            de.printStackTrace();
        }
        // step 5
View Full Code Here

Examples of com.lowagie.text.LwgFont

            float allColumns[] = new float[numColumns]; // left
            for (int k = 0; k < numColumns; ++k) {
                allColumns[k] = document.left() + (columnWidth + gutter) * k;
            }
            // set the fonts
            LwgFont font24B = FontFactory.getFont(FontFactory.TIMES_ROMAN, 24, LwgFont.BOLD);
            LwgFont font10B = FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, LwgFont.BOLD);
            LwgFont font14B = FontFactory.getFont(FontFactory.TIMES_ROMAN, 14, LwgFont.BOLD, new Color(255, 0, 0));
            LwgFont font9 = FontFactory.getFont(FontFactory.TIMES_ROMAN, 9);
            LwgFont font11 = FontFactory.getFont(FontFactory.TIMES_ROMAN, 11);
           
            // step 3: we open the document
            document.open();           
            // step 4:
            // get the stream content
View Full Code Here

Examples of com.lowagie.text.LwgFont

          new FileOutputStream("ChunkColor.pdf"));

      // step 3: we open the document
      document.open();
      // step 4:
      LwgFont red = FontFactory.getFont(FontFactory.HELVETICA, LwgFont.DEFAULTSIZE, LwgFont.BOLD, new Color(0xFF, 0x00, 0x00));
      LwgFont blue = FontFactory.getFont(FontFactory.HELVETICA, LwgFont.DEFAULTSIZE, LwgFont.ITALIC, new Color(0x00, 0x00, 0xFF));
      Paragraph p;
      p = new Paragraph("Roses are ");
      p.add(new Chunk("red", red));
      document.add(p);
      p = new Paragraph("Violets are ");
View Full Code Here

Examples of com.lowagie.text.LwgFont

        }

    }

    private static LwgElement newPara(String text, int alignment, int type) {
       LwgFont font = FontFactory.getFont("Helvetica", 10, type, Color.BLACK);
       Paragraph p = new Paragraph(text, font);
       p.setAlignment(alignment);
       p.setLeading(font.getSize() * 1.2f);
       return p;
    }
View Full Code Here

Examples of com.lowagie.text.LwgFont

        }

    }

    private static LwgElement newPara(String text, int alignment, int type) {
       LwgFont font = FontFactory.getFont("Helvetica", 10, type, Color.BLACK);
       Paragraph p = new Paragraph(text, font);
       p.setAlignment(alignment);
       p.setLeading(font.getSize() * 1.2f);
       return p;
    }
View Full Code Here

Examples of com.lowagie.text.LwgFont

           
            // we grab the ContentByte and do some stuff with it
            PdfContentByte cb = writer.getDirectContent();
           
            BaseFont bf = BaseFont.createFont(BaseFont.COURIER, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
            LwgFont font = new LwgFont(bf, 11, LwgFont.NORMAL);
           
            ColumnText ct = new ColumnText(cb);
            ct.setSimpleColumn(60, 300, 100, 300 + 28 * 15, 15, LwgElement.ALIGN_CENTER);
            ct.addText(new LwgPhrase(15, "UNI\n", font));
            for (int i = 0; i < 27; i++) {
View Full Code Here

Examples of com.lowagie.text.LwgFont

      document.open();
      // step 4:
      Chunk chunk;
      Paragraph p;
            String text = "Some.text.to.show.the.splitting.action.of.the.interface.";
            LwgFont font = FontFactory.getFont(FontFactory.HELVETICA, 24);
           
            document.add(new Paragraph("Normal split."));
            chunk = new Chunk(text, font);
            p = new Paragraph(24, chunk);
            document.add(p);
View Full Code Here

Examples of com.lowagie.text.LwgFont

            writer.setViewerPreferences(PdfWriter.PageModeUseOC);
            // step 3
            document.open();
            // step 4
            PdfContentByte cb = writer.getDirectContent();
            LwgPhrase explanation = new LwgPhrase("Automatic layer grouping and nesting", new LwgFont(LwgFont.HELVETICA, 20, LwgFont.BOLD, Color.red));
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_LEFT, explanation, 50, 650, 0);
            PdfLayer l12 = new PdfLayer("Layer nesting", writer);
            PdfLayer l1 = new PdfLayer("Layer 1", writer);
            PdfLayer l2 = new PdfLayer("Layer 2", writer);
            PdfLayer title = PdfLayer.createTitle("Layer grouping", writer);
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.