Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

我用itext想输出这样的内容

>  编制单位: xxxxxxx
>           yyyyyyy
>           zzzzzzz

代码:
p=new Paragraph("编制单位:xxxxxxxxx n yyyyyyyy",smallFont);
p.setAlignment(Element.ALIGN_LEFT);

其中xxxxxxxxx,yyyyyyy,zzzzzz要对齐.加入一定量空格可以解决但是空格数量并不对应着编制单位占用的空间,何况还有其它地方也要用到这种格式,那时候字体大小不一样就不知道到底加多少空格了.有什么好的解决办法吗?

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
718 views
Welcome To Ask or Share your Answers For Others

1 Answer

你好,我也有同样需求,你的解决了吗?求方法


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...