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));
}
}
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));
}
}
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();
}
}
}
Aggregations