Suppose if want to display set of invoice numbers in PDF print as a comma separated values, then there will a comma added along with last invoice number. Refer following sample to remove that unwanted comma
<table style="width:100%;>
<tr>
<td>
<#if record.apply?has_content>
<#assign inv = ''>
<#list record.apply as apply>
<#assign inv += apply.refnum + ','>
</#list>
<#assign len =inv?length>
${inv?substring(0,len-1)}
</#if>
</td>
</tr>
</table>