Long Text Field Data Display Issue in Output Document
In Output Documents, sometimes the text overlaps or extends beyond the page's border or is incomplete, instead of displaying on the next line. This issue is mostly seen when the text is in Japanese, Chinese, or Unicode format.
Workaround: To display the text in the same line, in the code after <div>, add <style="display: inline;"> within the <div> code block.
For more information about the Salesforce article related to the Salesforce PDF generation limitation, see
Visualforce PDF Rendering Considerations and Limitations.
To split the text evenly for long text, use the following sample JS script that identifies the extra space, counts the number of characters in long text, and splits the content evenly.
<div id="Desc2" style="width:680px;word-wrap: break-word;">
{{(
function(){
var ret = document.getElementById('Desc2');
var descPart1 = $D.Work_Order.SVMXC__Special_Instructions__c;
var words1;
if(descPart1 !=null ) {
var lng1=60;
words1 = descPart1.split(" ");
for (var j = 0; j < words1.length; j++) {
var l = words1[j].length;
if (l > lng1) {
var result = [], i = 0;
while (i < l) {
result.push(words1[j].substr(i, lng1));
i += lng1;
}
words1[j] = result.join(" ");
}
}
}
return ret.value=words1.join(" ");
})()}}
</div>