+ Start a Discussion
acrozieracrozier 

Exporting Rich Text Field to PDF

does anyone know of a way to make this work?  Currently the PDF populates with the HTML.

Best Answer chosen by Admin (Salesforce Developers) 
acrozieracrozier

I got this to work by using <outputText "escape=false" />

All Answers

Shashikant SharmaShashikant Sharma

Are you using getContentAsPdf Method to generate pdf?

Ankit AroraAnkit Arora

@Shashikant Hope problem will occur with both cases : using getContentAsPDF and renderAs="PDF". Just looking into the solution. Something related to displaying field on visualforce page which is rendering as PDF, should try using outputfields.

 

 

Thanks
Ankit Arora

 

Ankit AroraAnkit Arora

I would suggest you one thing. Don't use outputfield or inputfield use value like this :

 

<apex:outPutLabel>

{!.........}

</apex:outPutLabel>

 

Let me know if it doesn't help you.

 

 

Thanks
Ankit Arora

 

Devendra NataniDevendra Natani

Please try like that.

 

<apex:outPutLabel value="{!}">

</apex:outPutLabel>

 

Let me know if it doesn't help you.

 

 

Thanks
Devendra Natani

 

acrozieracrozier

Both outPutlabel and outputText give the same result.

SoloSolo

Hello,

 

I have the same issue 

 

SFDC support responded:

I have tried to replicate the same in my org, I get the HTML tags return as well in the Visual force page if I change the datatype of the field to rich text field. It is Working as Designed, it is the way the rich text field behave in a VF page.

I asked to clarify the issue with mext Tier because  this mean the  Rich Text can not be used in PDF documents normally and Rich text content will be showed in PDF not like "Rich text" but like  HTML code...

SoloSolo

Also Vote for Idea "Support export of Rich Text Field to PDF"

https://sites.secure.force.com/success/ideaView?id=08730000000bab5AAA

acrozieracrozier

I got this to work by using <outputText "escape=false" />

This was selected as the best answer
SoloSolo

Yes it's works. Also SF going to fix other issues while PDF generation fronm Rich text field. 

Luis_StakewareLuis_Stakeware

excelent, it works for me :)

Luis_StakewareLuis_Stakeware


excelent, it works for me :)
Harold CarlsonHarold Carlson
The <outputText escape="false" /> worked for me.  Still one of those little things that I can't believe SF hasn't addressed after all this time.