Search in sources :

Example 11 with RtfBasicElement

use of com.lowagie.text.rtf.RtfBasicElement in project itext2 by albfernandez.

the class RtfListItem method inheritListSettings.

/**
 * Inherit the list settings from the parent list to RtfLists that
 * are contained in this RtfListItem.
 *
 * @param listNumber The list number to inherit.
 * @param listLevel The list level to inherit.
 */
public void inheritListSettings(int listNumber, int listLevel) {
    for (int i = 0; i < chunks.size(); i++) {
        RtfBasicElement rtfElement = (RtfBasicElement) chunks.get(i);
        if (rtfElement instanceof RtfList) {
            ((RtfList) rtfElement).setListNumber(listNumber);
            setLevel(listLevel);
        // ((RtfList) rtfElement).setParent(this.parentList);
        }
    }
}
Also used : RtfBasicElement(com.lowagie.text.rtf.RtfBasicElement)

Example 12 with RtfBasicElement

use of com.lowagie.text.rtf.RtfBasicElement in project itext2 by albfernandez.

the class RtfHeaderFooter method writeContent.

/**
 * Writes the content of this RtfHeaderFooter
 */
public void writeContent(final OutputStream result) throws IOException {
    result.write(OPEN_GROUP);
    if (this.type == TYPE_HEADER) {
        if (this.displayAt == DISPLAY_ALL_PAGES) {
            result.write(HEADER_ALL);
        } else if (this.displayAt == DISPLAY_FIRST_PAGE) {
            result.write(HEADER_FIRST);
        } else if (this.displayAt == DISPLAY_LEFT_PAGES) {
            result.write(HEADER_LEFT);
        } else if (this.displayAt == DISPLAY_RIGHT_PAGES) {
            result.write(HEADER_RIGHT);
        }
    } else {
        if (this.displayAt == DISPLAY_ALL_PAGES) {
            result.write(FOOTER_ALL);
        } else if (this.displayAt == DISPLAY_FIRST_PAGE) {
            result.write(FOOTER_FIRST);
        } else if (this.displayAt == DISPLAY_LEFT_PAGES) {
            result.write(FOOTER_LEFT);
        } else if (this.displayAt == DISPLAY_RIGHT_PAGES) {
            result.write(FOOTER_RIGHT);
        }
    }
    result.write(DELIMITER);
    for (int i = 0; i < this.content.length; i++) {
        if (this.content[i] instanceof RtfBasicElement) {
            RtfBasicElement rbe = (RtfBasicElement) this.content[i];
            rbe.writeContent(result);
        }
    }
    result.write(CLOSE_GROUP);
}
Also used : RtfBasicElement(com.lowagie.text.rtf.RtfBasicElement)

Aggregations

RtfBasicElement (com.lowagie.text.rtf.RtfBasicElement)12 RtfParagraph (com.lowagie.text.rtf.text.RtfParagraph)3 DocumentException (com.lowagie.text.DocumentException)2 Element (com.lowagie.text.Element)2 List (com.lowagie.text.List)2 Paragraph (com.lowagie.text.Paragraph)2 RtfExtendedElement (com.lowagie.text.rtf.RtfExtendedElement)2 RtfColor (com.lowagie.text.rtf.style.RtfColor)2 ArrayList (java.util.ArrayList)2 Iterator (java.util.Iterator)2 Image (com.lowagie.text.Image)1 Phrase (com.lowagie.text.Phrase)1 PdfPTable (com.lowagie.text.pdf.PdfPTable)1 RtfChunk (com.lowagie.text.rtf.text.RtfChunk)1