设置文字
示例代码
package test.create.c08;
import iofd.layout.DefaultPageProperty;
import iofd.layout.OfdDocument;
import iofd.layout.block.Paragraph;
import iofd.layout.block.header.PageHeaderLine;
import iofd.layout.block.paragraph.Text;
import iofd.layout.block.tailer.PageFooterPanel;
import java.util.ArrayList;
import java.util.List;
import test.create.TestDocUtil;
/**
*
* */
public class C0801PageFooterText {
public static void main(String[] args) throws Throwable {
C0801PageFooterText o = new C0801PageFooterText();
o.done();
}
private void done() throws Throwable {
String clzName = this.getClass().getSimpleName();
System.out.println(clzName + " begin");
OfdDocument doc = new OfdDocument();
DefaultPageProperty prop = DefaultPageProperty.createDefaultPageProperty();
prop.setDebug(true);
prop.setHeadLine(new PageHeaderLine());
List tailerCreator = new ArrayList<>();
tailerCreator.add(new PageFooterPanel("测试页尾信息"));
prop.setFooterCreator(tailerCreator);
doc.setDefaultPageProperty(prop);
String s = "在页尾显示部分文字信息";
Paragraph p = new Paragraph();
p.add(new Text(s));
doc.add(p);
String fileName = TestDocUtil.getOfdFilePath(this.getClass());
doc.save(fileName);
System.out.println(clzName + " end");
}
}