Package com.lowagie.text

Examples of com.lowagie.text.LwgPhrase


            jpeg.setAlignment(LwgImage.MIDDLE);
            LwgImage png = LwgImage.getInstance("hitchcock.png");
            png.setAlignment(LwgImage.LEFT | LwgImage.UNDERLYING);
           
            for (int i = 0; i < 100; i++) {
                document.add(new LwgPhrase("Who is this? "));
            }
            document.add(gif);
            for (int i = 0; i < 100; i++) {
                document.add(new LwgPhrase("Who is this? "));
            }
            document.add(Chunk.NEWLINE);
            document.add(jpeg);
            for (int i = 0; i < 100; i++) {
                document.add(new LwgPhrase("Who is this? "));
            }
            document.add(png);
            for (int i = 0; i < 100; i++) {
                document.add(new LwgPhrase("Who is this? "));
            }
            document.add(gif);
            for (int i = 0; i < 100; i++) {
                document.add(new LwgPhrase("Who is this? "));
            }
            document.add(Chunk.NEWLINE);
            document.add(jpeg);
            for (int i = 0; i < 100; i++) {
                document.add(new LwgPhrase("Who is this? "));
            }
            document.add(png);
            for (int i = 0; i < 100; i++) {
                document.add(new LwgPhrase("Who is this? "));
            }
        }
        catch(DocumentException de) {
            System.err.println(de.getMessage());
        }
View Full Code Here


            // step 3: we open the document
            document.open();
           
            // step 4: we add content to the document
            for (int i = 0; i < 300; i++) {
                document.add(new LwgPhrase("Who is this? "));
            }
            PdfContentByte cb = writer.getDirectContent();
            java.awt.Image awtImage = Toolkit.getDefaultToolkit().createImage("H.gif");
            LwgImage image = LwgImage.getInstance(awtImage, null);
            image.setAbsolutePosition(100, 500);
View Full Code Here

      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));
      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));
     
      table.writeSelectedRows(0, -1, 50, pos, writer.getDirectContent());
    }

    catch (DocumentException de) {
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

     * Constructs a RtfHeaderGroup to which you add headers/footers using
     * via the setHeaderFooter method.
     *
     */
    public RtfHeaderFooterGroup() {
        super(new LwgPhrase(""), false);
        this.mode = MODE_NONE;
    }
View Full Code Here

     *
     * @param doc The RtfDocument this RtfHeaderFooter belongs to
     * @param type The type of RtfHeaderFooterGroup to create
     */
    public RtfHeaderFooterGroup(RtfDocument doc, int type) {
        super(new LwgPhrase(""), false);
        this.document = doc;
        this.type = type;
    }
View Full Code Here

     * @param doc The RtfDocument this RtfHeaderFooter belongs to
     * @param headerFooter The RtfHeaderFooterGroup to copy
     * @param type The type of RtfHeaderFooterGroup to create
     */
    public RtfHeaderFooterGroup(RtfDocument doc, RtfHeaderFooterGroup headerFooter, int type) {
        super(new LwgPhrase(""), false);
        this.document = doc;
        this.mode = headerFooter.getMode();
        this.type = type;
        if(headerFooter.getHeaderAll() != null) {
            this.headerAll = new RtfHeaderFooter(this.document, headerFooter.getHeaderAll(), RtfHeaderFooter.DISPLAY_ALL_PAGES);
View Full Code Here

     * @param doc The RtfDocument this RtfHeaderFooter belongs to
     * @param headerFooter The RtfHeaderFooter to display
     * @param type The type of RtfHeaderFooterGroup to create
     */
    public RtfHeaderFooterGroup(RtfDocument doc, RtfHeaderFooter headerFooter, int type) {
        super(new LwgPhrase(""), false);
        this.document = doc;
        this.type = type;
        this.mode = MODE_SINGLE;
        headerAll = new RtfHeaderFooter(doc, headerFooter, RtfHeaderFooter.DISPLAY_ALL_PAGES);
        headerAll.setType(this.type);
View Full Code Here

     * @param doc The RtfDocument this RtfHeaderFooter belongs to
     * @param headerFooter The HeaderFooter to display
     * @param type The type of RtfHeaderFooterGroup to create
     */
    public RtfHeaderFooterGroup(RtfDocument doc, HeaderFooter headerFooter, int type) {
        super(new LwgPhrase(""), false);
        this.document = doc;
        this.type = type;
        this.mode = MODE_SINGLE;
        headerAll = new RtfHeaderFooter(doc, headerFooter, type, RtfHeaderFooter.DISPLAY_ALL_PAGES);
        headerAll.setType(this.type);
View Full Code Here

         //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);
         ColumnText.showTextAligned(cb, PdfContentByte.ALIGN_LEFT, new LwgPhrase("Some text Left aligned", ft), 250, 600, 20);
         float size = ColumnText.getWidth(center, PdfWriter.RUN_DIRECTION_RTL, 0);
         cb.setRGBColorStroke(255, 0, 0);
         cb.rectangle(250 - size / 2, 690, size, 30);
         cb.stroke();
      }
View Full Code Here

TOP

Related Classes of com.lowagie.text.LwgPhrase

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.