Limiting characters of description in every line of the PDF Template.

If the numbers of characters have to to limit to particular numbers in the every line in the pdf template use substring(from,toExclusive) function.

 <#assign desc_len=item.description?length><tr>
	<td colspan="7" style="width: 309px;"><p style = "text-align:left;" >
      
      <span style="color:#0f0e0e; "><#if desc_len &lt; 50>${x}<#elseif desc_len &gt; 100>${item.description?substring(0,50)}<br />${item.description?substring(50,100)}<br />${item.description?substring(50,desc_len)}<#else>${item.description?substring(0,50)}<br />${item.description?substring(50,desc_len)}</#if></span></p></td>

Leave a comment

Your email address will not be published. Required fields are marked *