Package com.lowagie.text

Examples of com.lowagie.text.LwgFont


    }
   
    public BaseFont getFont() {
        if (font != null)
            return font;
        LwgFont ff2 = FontFactory.getFont(faceName, BaseFont.CP1252, true, 10, ((italic != 0) ? LwgFont.ITALIC : 0) | ((bold != 0) ? LwgFont.BOLD : 0));
        font = ff2.getBaseFont();
        if (font != null)
            return font;
        String fontName;
        if (faceName.indexOf("courier") != -1 || faceName.indexOf("terminal") != -1
            || faceName.indexOf("fixedsys") != -1) {
View Full Code Here


   * @param args
   *            no arguments needed
   */
  public static void main(String[] args) {

    LwgFont font8 = FontFactory.getFont(FontFactory.HELVETICA, 8);
   
    // step 1
    LwgDocument document = new LwgDocument(LwgPageSize.A4);

    try {
View Full Code Here

      PdfWriter.getInstance(document,
          new GfrFileOutputStream("com.lowagie.examples.objects.tables.pdfptable.FragmentTable.pdf"));
      // step3
      document.open();
      // step4
      LwgFont font = FontFactory.getFont("Helvetica", 8, LwgFont.BOLD,
          Color.BLACK);

      LwgPdfPTable table = new LwgPdfPTable(2);
      table.setWidthPercentage(100f);
View Full Code Here

            BaseFont bf = BaseFont.createFont("Helvetica", "winansi", false);
            table.getDefaultCell().setPaddingTop(bf.getFontDescriptor(BaseFont.ASCENT, fontSize) - fontSize + 2);
            table.getDefaultCell().setBorder(LwgRectangle.NO_BORDER);
            for (int k = 0; k < 500 * 4; ++k) {
                if (k == 0)
                    table.add(new LwgPhrase("This is an URL", new LwgFont(bf, fontSize)));
                else
                    table.add(new LwgPhrase(String.valueOf(k), new LwgFont(bf, fontSize)));
            }
            table.setTableEvent(event);
            table.setHeaderRows(3);
            document.add(table);
        }
View Full Code Here

            for (int k = 0; k < widths.length; ++k) {
                if (widths[k] != 0)
                    widths[k] = 1000;
            }
            bf.setForceWidthsOutput(true);
            document.add(new Paragraph("A big text to show Helvetica with fixed width.", new LwgFont(bf)));
        }
        catch (Exception de) {
            de.printStackTrace();
        }
        // step 5
View Full Code Here

          new GfrFileOutputStream("com.lowagie.examples.fonts.styles.FontColor.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

         cb.stroke();

         // we construct a font
         //BaseFont bf = BaseFont.createFont("c:\\windows\\fonts\\arialuni.ttf", BaseFont.IDENTITY_H, true);
         BaseFont bf = BaseFont.createFont("c:\\windows\\fonts\\comic.ttf", BaseFont.IDENTITY_H, true);
         LwgFont ft = new LwgFont(bf, 12);
         // This is the text:
         String text = "\u0623\u0648\u0631\u0648\u0628\u0627, \u0628\u0631\u0645\u062c\u064a\u0627\u062a \u0627\u0644\u062d\u0627\u0633\u0648\u0628 + \u0627\u0646\u062a\u0631\u0646\u064a\u062a :";
         LwgPhrase center = new LwgPhrase(text + " Center", ft);
         ColumnText.showTextAligned(cb, PdfContentByte.ALIGN_CENTER, center, 250, 700, 0, PdfWriter.RUN_DIRECTION_RTL, 0);
         ColumnText.showTextAligned(cb, PdfContentByte.ALIGN_RIGHT, new LwgPhrase(text + " Right", ft), 250, 650, 20, PdfWriter.RUN_DIRECTION_RTL, 0);
View Full Code Here

            table.getDefaultCell().setBorder(LwgRectangle.NO_BORDER);
            for (int k = 0; k < 500 * 4; ++k) {
                if (k == 0) {
                    table.getDefaultCell().setColspan(4);
                    table.getDefaultCell().setHorizontalAlignment(LwgElement.ALIGN_CENTER);
                    table.add(new LwgPhrase("This is an URL", new LwgFont(bf, fontSize * 2)));
                    table.getDefaultCell().setColspan(1);
                    table.getDefaultCell().setHorizontalAlignment(LwgElement.ALIGN_LEFT);
                    k += 3;
                }
                else
                    table.add(new LwgPhrase(String.valueOf(k), new LwgFont(bf, fontSize)));
            }
            table.setTableEvent(event);
            table.setHeaderRows(3);
            document.add(table);
        }
View Full Code Here

          new GfrFileOutputStream("com.lowagie.examples.fonts.styles.ExtraStyles.rtf"));

      // step 3: we open the document
      document.open();
      // step 4:
      LwgFont font;
      Chunk chunk;
      font = FontFactory.getFont(FontFactory.HELVETICA, LwgFont.DEFAULTSIZE, LwgFont.UNDERLINE);
      chunk = new Chunk("underline", font);
      document.add(chunk);
      font = FontFactory.getFont(FontFactory.HELVETICA, LwgFont.DEFAULTSIZE, LwgFont.NORMAL);
View Full Code Here

          new GfrFileOutputStream("com.lowagie.examples.fonts.styles.FontStylePropagation.pdf"));

      // step 3: we open the document
      document.open();
      // step 4:
      LwgPhrase myPhrase = new LwgPhrase("Hello 1! ", new LwgFont(LwgFont.TIMES_ROMAN, 8, LwgFont.BOLD));
            myPhrase.add(new LwgPhrase("some other font ", new LwgFont(LwgFont.HELVETICA, 8)));
            myPhrase.add(new LwgPhrase("This is the end of the sentence.\n", new LwgFont(LwgFont.TIMES_ROMAN, 8, LwgFont.ITALIC)));
            document.add(myPhrase);
           
            myPhrase = new LwgPhrase(12);
            myPhrase.add(new LwgPhrase("Hello 2! ", new LwgFont(LwgFont.TIMES_ROMAN, 8, LwgFont.BOLD)));
            myPhrase.add(new LwgPhrase("This is the end of the sentence.\n", new LwgFont(LwgFont.TIMES_ROMAN, 8, LwgFont.ITALIC)));
            document.add(myPhrase);
           
            myPhrase = new LwgPhrase("Hello 3! ", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, LwgFont.BOLD));
            myPhrase.add(new LwgPhrase("some other font ", FontFactory.getFont(FontFactory.HELVETICA, 8)));
            myPhrase.add(new LwgPhrase("This is the end of the sentence.\n", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, LwgFont.ITALIC)));
            document.add(myPhrase);
           
            Paragraph myParagraph = new Paragraph("Hello 1bis! ", new LwgFont(LwgFont.TIMES_ROMAN, 8, LwgFont.BOLD));
            myParagraph.add(new Paragraph("This is the end of the sentence.", new LwgFont(LwgFont.TIMES_ROMAN, 8, LwgFont.ITALIC)));
            document.add(myParagraph);
           
            myParagraph = new Paragraph(12);
            myParagraph.add(new Paragraph("Hello 3bis! ", new LwgFont(LwgFont.TIMES_ROMAN, 8, LwgFont.BOLD)));
            myParagraph.add(new Paragraph("This is the end of the sentence.", new LwgFont(LwgFont.TIMES_ROMAN, 8, LwgFont.ITALIC)));
            document.add(myParagraph);
    } catch (DocumentException de) {
      System.err.println(de.getMessage());
    } catch (IOException ioe) {
      System.err.println(ioe.getMessage());
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.