Play Games

Search This Blog

Thursday, June 12, 2014

How to display image in word document?


step 1 :First upload the image to document.

Procedure: click on documents tab,then click new.Enter the details and upload the image.

Note:Make sure Externally available image checkbox is clicked.
step 2:now create the visualforce page with the following code.

<apex:page contentType="application/msword#Test.doc">
<head>
</head>
<body>
  This is your new Page
<apex:image url="https://c.ap1.content.force.com/servlet/servlet.ImageServer?id=01590000003w0sx&oid=00D90000000j4R8
 &lastMod=1399273218000" width="50" height="50" />
</body>
</apex:page>


note: To get image url,follow the steps

step 1:open the document where you uploaded the image.
step 2:Right click on the image icon and then copy image location.

Replace url of <apex:image> with the above copied image url.


When you run the visualforce page, the ouptut will be as follows.


No comments:

Post a Comment