设置空格
示例代码
package test.create.c01;
import iofd.layout.OfdDocument;
import iofd.layout.block.Paragraph;
import iofd.layout.block.paragraph.Text;
import test.create.TestDocUtil;
/**
* 展示如何设置空格
* */
public class C0105BlankSpace {
public static void main(String[] args) throws Throwable {
C0105BlankSpace o = new C0105BlankSpace();
o.done();
}
private void done() throws Throwable {
String clzName = this.getClass().getSimpleName();
System.out.println(clzName + " begin");
/*
* 展示如何设置空格
* */
String s = " Hello World ";
OfdDocument doc = new OfdDocument();
Paragraph p = new Paragraph();
Text text = new Text(s);
p.add(text);
doc.add(p);
String fileName = TestDocUtil.getOfdFilePath(this.getClass());
doc.save(fileName);
System.out.println(clzName + " end");
}
}