0

I have a richtext area on Account object. This field as some text and an image etc. This is my simple visuaforce page to get the page as a doc.

<apex:page standardController="Account" contentType="application/msword#filename.doc" applyHtmlTag="false" applyBodyTag="false" showHeader="false"> 
 <apex:outputField value="{!Account.Arichtext__c}"/>
</apex:page>

When I save it, a doc file gets downloaded with no image and only text: enter image description here

However when I use only renderAs="pdf" in my VF page. I get the image as well as the text:

<apex:page standardController="Account" renderas="pdf" applyHtmlTag="false" applyBodyTag="false" showHeader="false">
 <apex:outputField value="{!Account.Arichtext__c}"/>
</apex:page>

enter image description here

On reading further online it seems like Rich text image cannot come in doc type.

  1. https://developer.salesforce.com/forums/?id=906F000000098wOIAQ
  2. Images are not displaying in MS Word Doc

Is there really a solution available to have this image come in the word document? Any ideas?

1 Answer 1

1

In rich text the image is stored in different server (content.force.com) you can check it using inspect element did you tried

<apex:outputText escape="false" value="{!Account.Arichtext__c}"/>

it will work if you save it as HTML saving as doc will not work as images hosted on the different server. In the case of PDF Salesforce is taking the responsibility of rendering the image.

3

You must log in to answer this question.

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