You need to sign in to do that
Don't have an account?

PDF image not displayed
Hi,
When i render my VF page as PDF the image inside is not getting displayed from Static Resource.
I tried using image and apex tags both did not work.
<img src="{!URLFOR($Resource.Name)}" width="100px;"/>
<apex:image value="data:image;base64,{!$Resource.Name}"/>
The same is getting displayed from VF page. Any idea ?
I also tried searching and tried to implement the below solution which did not work for me properly.
<style>
@page {
margin : 70pt .5in .5in .5in;
@top-center {
content : "My Header";
}
@bottom-left {
content : "My Footer on Left Side";
font-size : 10 px;
color : #808080;
}
@bottom-center {
content : "My Footer in center" ;
font-size : 10 px;
color : #808080;
}
@top-center {
content : element(header);
}
div.header {
position : running(header) ;
background-image:url(https://myURL);
}
}
</style>
<div class="header">
<center><img src="{!$Resource.Name}" width="25%"/></center>
</div>
When i render my VF page as PDF the image inside is not getting displayed from Static Resource.
I tried using image and apex tags both did not work.
<img src="{!URLFOR($Resource.Name)}" width="100px;"/>
<apex:image value="data:image;base64,{!$Resource.Name}"/>
The same is getting displayed from VF page. Any idea ?
I also tried searching and tried to implement the below solution which did not work for me properly.
<style>
@page {
margin : 70pt .5in .5in .5in;
@top-center {
content : "My Header";
}
@bottom-left {
content : "My Footer on Left Side";
font-size : 10 px;
color : #808080;
}
@bottom-center {
content : "My Footer in center" ;
font-size : 10 px;
color : #808080;
}
@top-center {
content : element(header);
}
div.header {
position : running(header) ;
background-image:url(https://myURL);
}
}
</style>
<div class="header">
<center><img src="{!$Resource.Name}" width="25%"/></center>
</div>
If you have an image added as an attachment or in Document section, get the image id by viewing through the URL and add it in the below way.
<img src="/servlet/servlet.ImageServer?id=112547264&oid=004623423402K3457&lastMod=135435432534"