Package com.lowagie.text

Examples of com.lowagie.text.LwgFont


      // step3
      document.open();
      // step4
     
      // page 1
          LwgFont tableFont = FontFactory.getFont("Helvetica", 8, LwgFont.BOLD, Color.BLACK);
          float padding = 0f;
          LwgRectangle border = new LwgRectangle(0f, 0f);
          border.setBorderWidthLeft(6f);
          border.setBorderWidthBottom(5f);
          border.setBorderWidthRight(4f);
          border.setBorderWidthTop(2f);
          border.setBorderColorLeft(Color.RED);
          border.setBorderColorBottom(Color.ORANGE);
          border.setBorderColorRight(Color.YELLOW);
          border.setBorderColorTop(Color.GREEN);
          makeTestPage(tableFont, border, writer, document, padding, true, true);
          LwgFont font = FontFactory.getFont("Helvetica", 10);
          Paragraph p;
          p = new Paragraph("\nVarious border widths and colors\nuseAscender=true, useDescender=true", font);
          document.add(p);
         
          document.newPage();
View Full Code Here


            // step 3
            document.open();
            // step 4
            PdfContentByte cb = writer.getDirectContent();
            BaseFont bf = BaseFont.createFont("c:\\windows\\fonts\\times.ttf", BaseFont.IDENTITY_H, true);
            LwgFont f2 = new LwgFont(bf, 24, LwgFont.NORMAL, Color.BLUE);
            float llx = 100;
            float lly = 100;
            float urx = 500;
            float ury = 800;
            ColumnText ct = new ColumnText(cb);
            ct.setSimpleColumn(llx, lly, urx, ury, 24, LwgElement.ALIGN_LEFT);
            ct.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
            ct.setLeading(0, 1);
            ct.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
            ct.setAlignment(LwgElement.ALIGN_CENTER);
            ct.addText(new Chunk(ar1, new LwgFont(bf, 16)));
            ct.addText(new Chunk(ar2, new LwgFont(bf, 16, LwgFont.NORMAL, Color.red)));
            ct.go();
            ct.setAlignment(LwgElement.ALIGN_JUSTIFIED);
            ct.addText(new Chunk(ar3, new LwgFont(bf, 12)));
            ct.go();
            ct.setAlignment(LwgElement.ALIGN_CENTER);
            ct.addText(new Chunk(ar4, new LwgFont(bf, 14)));
            ct.go();
           
            ct.setSpaceCharRatio(PdfWriter.SPACE_CHAR_RATIO_DEFAULT);
            ct.setAlignment(LwgElement.ALIGN_CENTER);
            ct.addText(new Chunk("\n\n\n", new LwgFont(bf, 16)));
            ct.addText(new Chunk(he1, new LwgFont(bf, 16)));
            ct.addText(new Chunk(he2, new LwgFont(bf, 16, LwgFont.NORMAL, Color.red)));
            ct.go();
            ct.setAlignment(LwgElement.ALIGN_JUSTIFIED);
            ct.addText(new Chunk(he3, new LwgFont(bf, 12)));
            ct.go();
            ct.setAlignment(LwgElement.ALIGN_CENTER);
            ct.addText(new Chunk(he4, new LwgFont(bf, 14)));
            ct.go();
           
            document.newPage();
            String atext = "\u062a\u0635\u0628\u062d ";
            LwgPdfPTable table = new LwgPdfPTable(5);
View Full Code Here

                cb.rectangle(x, y, -leading * (maxLines - 1), -height);
                cb.stroke();
                int status;
                VerticalText vt = new VerticalText(cb);
                vt.setVerticalLayout(x, y, height, maxLines, leading);
                vt.addText(new Chunk(texts[idx++], new LwgFont(bf, 20)));
                vt.addText(new Chunk(texts[idx++], new LwgFont(bf, 20, 0, Color.blue)));
                status = vt.go();
                System.out.println(status);
                vt.setAlignment(LwgElement.ALIGN_RIGHT);
                vt.addText(new Chunk(texts[idx++], new LwgFont(bf, 20, 0, Color.orange)));
                status = vt.go();
                System.out.println(status);
                document.newPage();
            }
            document.close();
View Full Code Here

            // 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.WINANSI, BaseFont.EMBEDDED);
            LwgFont font = new LwgFont(bfComic, 12);
            String text1 = "quick brown fox jumps";
            String text2 = " over ";
            String text3 = "the lazy dog";
            document.add(new Paragraph(text1, font));
            document.add(new Paragraph("width: " + bfComic.getWidthPoint(text1, 12)));
View Full Code Here

TOP

Related Classes of com.lowagie.text.LwgFont

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.