设置行高

显示效果:

示例代码所生成的OFD文件:下载

 示例代码

package test.create.c02;

import iofd.layout.OfdDocument;
import iofd.layout.block.Paragraph;
import iofd.layout.block.paragraph.Text;
import test.create.TestDocUtil;

/**
 * 展示如何设置行高
 * */
public class C0204SetLineHeight {

	public static void main(String[] args) throws Throwable {
		C0204SetLineHeight o = new C0204SetLineHeight();
		o.done();
	}

	private void done() throws Throwable {
		String clzName = this.getClass().getSimpleName();
		System.out.println(clzName + " begin");
		
		String s = "这是展示如何设置字体大小:3.请务必认真仔细阅读并评估本活动计划书及其所包含的所有细节内容,尤其是本计划书特别强调的相关内容,否则,谢绝报名或参与;";
		
		OfdDocument doc = new OfdDocument();
		Paragraph p = new Paragraph();
		Text text = new Text(s);
		p.add(text);
		/*
		 * 设置为2倍行高
		 * */
		p.setRowHeightTypeVal(2f);
		doc.add(p);
		
		String fileName = TestDocUtil.getOfdFilePath(this.getClass());
		doc.save(fileName);
		System.out.println(clzName + " end");
	}
}