Break Long Descriptions Using Advanced PDF/Html

There are scenarios when an Item Description on an Advanced PDF Template is too long which causes the Item row to be printed on the next page. This article shows how to split the description to print on 2 pages and display it in sub-paragraphs in multiple rows.

<pre><code class="language-suitescript"><#list item.description?split("<br />") as paragraph> 
<#if paragraph_index == 0> 
    <tr>
    <td align="center" colspan="3" line-height="150%">${‌item.quantity}</td>
    <td colspan="12"><span class="itemname">${‌item.item}</span><br />${‌paragraph}</td>
    <td colspan="3">${‌item.options}</td>
    <td align="right" colspan="4">${‌item.rate}</td>
    <td align="right" colspan="4">${‌item.amount}</td>
    </tr>
    <#else>
    <tr>
    <td align="center" colspan="3" line-height="150%"></td>                      
    <td colspan="12">${‌paragraph}</td>
    <td colspan="3"></td>
    <td align="right" colspan="4"></td>
    <td align="right" colspan="4"></td>
    </tr>
    </#if>
</#list></code></pre>

Leave a comment

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