1

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!

4
  • I think its the email as a continuous string without spaces that will prevent you from wrapping, all of the css will be ignored because it doesn't know where to wrap. I think your only option is to clip the content to a max-width using overflow: hidden; Nov 19, 2015 at 13:22
  • 1
    Also, css3 won't work with VF PDF, it is only css2 compliant Nov 19, 2015 at 13:22
  • No use of hidden property. Also i dont want to clip. Nov 19, 2015 at 13:35
  • If text is hidden then we can't see the text Nov 20, 2015 at 7:07

1 Answer 1

2

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 /> 

5
  • tried, not working @Pri Nov 19, 2015 at 10:45
  • Try the above method. Nov 19, 2015 at 11:39
  • i don't know how to use apex:component. Could you show me the vf page with all the components(apex:component and apex:repeat) inside apex:page Nov 19, 2015 at 12:16
  • I have modified the above answer for your understanding.Check whether you can get anything from it. Nov 19, 2015 at 13:21
  • Unknown constructor 'break.break(ApexPages.StandardController controller)' Nov 19, 2015 at 13:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .