简体   繁体   English

iText 设置单元格的高度

[英]iText set cell's height

I am using a java version of this library and can't figure out how to set the cell's height.我正在使用此库的 Java 版本,但无法弄清楚如何设置单元格的高度。 When I use cell.setFixedHeight() and passing any number less that 18 the content dissapears in output PDF file.当我使用 cell.setFixedHeight() 并传递小于 18 的任何数字时,输出 PDF 文件中的内容会消失。 Why?为什么? Thank you谢谢

Check whether the width and height given for document is not exceeds.检查文档给定的宽度和高度是否不超过。

Document document = new Document(PageSize.A4, 60, 60, 120, 80);文档文档 = 新文档(PageSize.A4, 60, 60, 120, 80);

and for cell height you have to give in float value for eg对于单元格高度,您必须提供浮点值,例如

Cell.setFixedHeight(45f); Cell.setFixedHeight(45f);

I hope this will help you to proceed further :-)我希望这会帮助你进一步:-)

对此的新答案是cell.setMinHeight(10f);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM