I have a requirement to print email tasks as PDF. As standard printable view option will support on Task records, I have created a custom visualforce page with render as "PDF" as below:
<apex:page StandardController = "Task" renderAs="pdf">
<apex:form >
<apex:pageBlock >
Subject: {!Task.Subject} <br/><br/>
Sent Date: {!Task.Createddate}<br/><br/>
From: {!Task.Owner.Email}<br/><br/>
Email: {!Task.Description}
</apex:pageBlock>
</apex:form>
</apex:page>
Now, I could able to successfully print the page but the text is coming unformatted. It is as follows:
Email: from: [email protected] Response for owner id Test On Tue, Mar 8, 2022 at 2:19 PM
Email output < wrote: > Lorem ipsum dolor sit amet> Lorem ipsum dolor sit amet > Lorem ipsum dolor sit amet > Lorem ipsum dolor sit amet > Lorem ipsum dolor sit amet > Lorem ipsum dolor sit amet
Is there anyway where we can print the above information as following
Also, can anyone suggest how to trim text till "wrote:" and only print the actual content.
Thanks!