设置纸张方向
示例代码
package test.create.c05;
import iofd.layout.DefaultPageProperty;
import iofd.layout.OfdDocument;
import iofd.layout.block.Paragraph;
import iofd.layout.block.paragraph.Text;
import iofd.layout.contants.PaperRotation;
import test.create.TestDocUtil;
/**
*
* */
public class C0504PageRotationHorizontal {
public static void main(String[] args) throws Throwable {
C0504PageRotationHorizontal o = new C0504PageRotationHorizontal();
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.setRotation(PaperRotation.HORIZONTAL);
doc.setDefaultPageProperty(prop);
Paragraph p = new Paragraph();
p.add(new Text("页面设置为横向模式"));
doc.add(p);
String fileName = TestDocUtil.getOfdFilePath(this.getClass());
doc.save(fileName);
System.out.println(clzName + " end");
}
}