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:
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>
On reading further online it seems like Rich text image cannot come in doc type.
- https://developer.salesforce.com/forums/?id=906F000000098wOIAQ
- 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?
Best Answer
In rich text the image is stored in different server (content.force.com) you can check it using inspect element did you tried
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.