i downloaded the last version of iTextSharp dll. I generated a PdfPTable object and i have to set it's height. Despite to set width of PdfPTable, im not able to set height of it. Some authors suggest to use 'setFixedHeight' method. But the last version of iTextSharp.dll has not method as 'setFixedHeight'. It's version is 5.5.2. How can i do it?
相关问题
- Trying to insert an image into a pdf in c#
- Get image width height javascript
- How to know if element height or width was set in
- Trying to convert plain text file to iTextSharp wi
- can an element have a a decimal height in html/css
相关文章
- .NET version or port of Flying Saucer
- iTextSharp “The document has no pages.”
- jQuery outer height is zero?
- The height of the code-mirror block are not the sa
- How to detect newline from PDF using iTextSharp [c
- iTextSharp - how to open/read/extract a file attac
- PdfPTable cell width
- Append PDF to a Signed PDF
Setting a table's height doesn't make sense once you start thinking about it. Or, it makes sense but leaves many questions unanswered or unanswerable. For instance, if you set a two row table to a height of 500, does that mean that each cell get's 250 for a height? What if a large image gets put in the first row, should the table automatically respond by splitting 400/100? Then what about large content in both rows, should it squish those? Each of these scenarios produces different results that make knowing what a table will actually do unreliable. If you look at the HTML spec you'll see that they don't even allow setting a fixed height for tables.
However, there's a simple solution and that's just setting the fixed height of the cells themselves. As long as you aren't using
new PdfPCell()
you can just setDefaultCell.FixedHeight
to whatever you want.If you are manually creating cells then you need to set the
FixedHeight
on each:However, if you want normal table-ness and must set a fixed height that chops things that don't fit you can also use a
ColumnText
. I wouldn't recommend this but you might have a case for it. The code below will only show six rows.you can use any one of following
or
The premise is that you have downloaded the jar iText jar,you can try this code,you can achive this function,In a A4 paper out a row of three columns of dataeg: