[SalesForce] Any solution found for word-wrap in VF PDF

Searched nearly one day but could'nt find the solution for this. There are lot of questions regarding word-wrap is not working on pdf but none of them have answers.

am just fetching the contacts email like below

<td>{!Contact.Email__c}</td>

Problem : Whenever the contact email is large/big one then it should break the line.

Used all those css properites like word-wrap, overflow, break-word, white-space…. but no use of these.

Somewhere I found that CSS3 properties are not supported by PDF generating engine.

Any solution for this?

Thanks in Advance!

Best Answer

In case of plain text,you can use \r\n.You can try using a VisualForce component

Component(Develop->Visualforce components):Add the following

 <apex:component controller="break" access="global" >

<apex:outputText value="{!break}" />

Controller:In classes

public class break {

public String break {

    get { return '\r\n'; }

    set;

}

And use the component's id in visualforce page:

<apex:repeat value="{!Contact.Email__c}" var="c">

    <apex:outputText value="{!c.ID}" />

    <c:break />