Search in sources :

Example 1 with RtfDirectContent

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

the class RtfDestinationDocument method writeText.

/**
 * Write the string value to the destination.
 * Used for direct content
 * @param value
 */
private void writeText(String value) {
    if (this.rtfParser.isNewGroup()) {
        this.rtfDoc.add(new RtfDirectContent("{"));
        this.rtfParser.setNewGroup(false);
    }
    if (value.length() > 0) {
        this.rtfDoc.add(new RtfDirectContent(value));
    }
}
Also used : RtfDirectContent(com.lowagie.text.rtf.direct.RtfDirectContent)

Example 2 with RtfDirectContent

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

the class RtfDestinationShppict method writeText.

private void writeText(String value) {
    if (this.rtfParser.getState().newGroup) {
        this.rtfParser.getRtfDocument().add(new RtfDirectContent("{"));
        this.rtfParser.getState().newGroup = false;
    }
    if (value.length() > 0) {
        this.rtfParser.getRtfDocument().add(new RtfDirectContent(value));
    }
}
Also used : RtfDirectContent(com.lowagie.text.rtf.direct.RtfDirectContent)

Example 3 with RtfDirectContent

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

the class RtfParser method outputDebug.

public static void outputDebug(Object doc, int groupLevel, String str) {
    System.out.println(str);
    if (doc == null)
        return;
    if (groupLevel < 0)
        groupLevel = 0;
    char[] a;
    Arrays.fill(a = new char[groupLevel * 2], ' ');
    String spaces = new String(a);
    if (doc instanceof RtfDocument) {
        ((RtfDocument) doc).add(new RtfDirectContent("\n" + spaces + str));
    } else if (doc instanceof Document) {
        try {
            ((Document) doc).add(new RtfDirectContent("\n" + spaces + str));
        } catch (DocumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
Also used : RtfDirectContent(com.lowagie.text.rtf.direct.RtfDirectContent) DocumentException(com.lowagie.text.DocumentException) RtfDocument(com.lowagie.text.rtf.document.RtfDocument) RtfDocument(com.lowagie.text.rtf.document.RtfDocument) Document(com.lowagie.text.Document)

Aggregations

RtfDirectContent (com.lowagie.text.rtf.direct.RtfDirectContent)3 Document (com.lowagie.text.Document)1 DocumentException (com.lowagie.text.DocumentException)1 RtfDocument (com.lowagie.text.rtf.document.RtfDocument)1