function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krishna chaitanya 35krishna chaitanya 35 

images are not displaying in Visualforce page when rendered as word document and repetition of footer

Hi All,
I am trying to display case object content to word document,everything is successfull except two things.
1.Footer is displaying under the header information.
2.Image is not displayed when the word document is downloaded.

==============Sample Code and out put ===================================
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
     <style type="text/css">
     
                
             p.MsoFooter, li.MsoFooter, div.MsoFooter{
                    margin:0in;
                    margin-bottom:.0001pt;
                    mso-pagination:widow-orphan;
                    tab-stops:center 3.0in right 6.0in;
                }
                @page Section1{
                    size:8.5in 11.0in; 
                    margin:0.5in 0.5in 0.5in 0.5in;
                    mso-footer:f1; 
                    mso-footer-margin:0.5in;
                    mso-paper-source:0;
                }
                div.Section1{
                    page:Section1;
                }
                /*Below is the style to prevent the repetition of header and Footer.. Cheers!!!*/
                table#hrdftrtbl{
                margin:0in 0in 0in 15in;
            } 
                
            </style>
</head> 
     <apex:form >
   
    <body>
    
        <div class="Section1">
           <table width="100%" border="1" id="hrdftrtbl">
             <td>
             <div>
              <!--Header-->
             <!--<div style='mso-element:header' id="h1" >
             <p class="MsoHeader">-->
                <tr >
                  <td width="40%" align="Center" style="margin-left: -20px;">
                           
                            <apex:image value="https://c.cs84.content.force.com/servlet/servlet.ImageServer?id=0155E0000001AK5QAM&oid=00D5E0000004byY&lastMod=1455786672000&contentType=image/png" width="150" height="75"/>
                   </td>
                    <td width="40%" align="center" >
                     <b><span style="font-size: 14.5px;">test </span></b><br/>
                     <b><span style="font-size: 16px;padding-left: 5px;">test</span></b> 
                  </td> 
                  
                     <td width="20%" align="center">
                    <span >Created Date:</span> <br/>
                    <apex:outputText value="{0,date,dd'-'MMM'-'yyyy}">
                            <apex:param value="{!Case.CreatedDate}"/>
                            </apex:outputText>
                    
                       </td>     
                    </tr> 
                <!--</p>-->
                 </div>
                 </td>
            </table>

                     <div style='mso-element:footer' id="f1" class="MsoFooter,Section1" >
                                <p class="MsoFooter">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0" >
                                        <tr>
                                            <td width="50%">
                                                Constructed: test{!case.Createdby.name}<br/>
                                                test
                                            </td>
                                            <td align="center" width="20%">
                                            <apex:outputText value="{0,date,dd'-'MMM'-'yyyy}">
                                            <apex:param value="{!Case.CreatedDate}"/>
                                            </apex:outputText>
                                            </td>
                                            <td align="center" width="30%">
                                                Page <span style='mso-field-code: PAGE '></span> of <span style='mso-field-code: NUMPAGES '></span>
                                                <br/>
                                                Print Date:<apex:outputText value="{0,date,dd'-'MMM'-'yyyy}">
                                                <apex:param value="{!today()}"/>
                                                </apex:outputText>
                                            </td>
                                        </tr>
                                    </table>
                                </p>
                            </div>
        
   </div>        
=================Sample Output========================User-added image
Sree NivasSree Nivas
Please store images in static resource then fetch them like below, i hope you are issue will resolve
"<apex:image url="{!$Resource.TestImage}" width="50" height="50"/>"
PawanKumarPawanKumar
Hi Sree,
You  just add your image url to Remote Site Setting, it will work fine.
setup->Security Controls->Remote Site

Please let me know if it works for you.

Regards,
Pawan Kumar
PawanKumarPawanKumar
sorry for the wrong name, Krishna.
krishna chaitanya 35krishna chaitanya 35
Hi @pawanKumar,
I added in remote site settings and tried the same.But it is not working.
krishna chaitanya 35krishna chaitanya 35
HI Sree Nivas,
I added the image in static resources  and tried the same.But it is not working.Any suggestions for footer information?
ManjusrinuManjusrinu

Hi,

Even i have faced the same issue.

Just try Enable Editting in your word document ,you can see the image.

I have got the image