I'm creating a document using the BFO Report library (embedded in NetSuite ERP).
I have a text block which I would like to limit to two lines, truncating if it's more than that, but I can't seem to get overflow:hidden
to actually do anything. Setting height
limits the minimum height, but if the text is longer it extends the containing rather than being cut off.
Here's the document I'm rendering:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pdf PUBLIC '-//big.faceless.org//report' 'report-1.1.dtd'>
<pdf>
<body width="3in" height="1.25in" padding="0">
<div font-family="sans-serif" font-size="14pt" width="3in" height="2em" border="1px solid green" overflow="hidden">
<p margin="0">Short Name</p>
</div>
<pbr/>
<div font-family="sans-serif" font-size="14pt" width="3in" height="2em" border="1px solid green" overflow="hidden">
<p margin="0">This Is An Item With A Really Extremely Long Name That Doesn't Fit</p>
</div>
</body>
</pdf>
And the resulting PDF: