render Blob image in PDF using Visualforce

Hi below is a snippet of a code where i am rerendering as pdf and have a blob image stored in a text field. When i display the blob image in VF page it displays fine, but when i display same image with rerender as pdf the image gets corrupted. I tried this post too, but doesn’t seem to work Render a Visualforce page as PDF issues.

<apex:page standardController="Contract_Partner__c" showHeader="false" applyBodyTag="false" 
    renderAs="pdf" >
    <!-- Below image is not displayed-->
      <apex:image value="data:image;base64,{!Contract_Partner__c.Signature__c}" />

</apex:page>

Any pointers on how to get this working.

Answer

An alternative is to save the blob as an attachment against your record and then add this to your pdf. If you gave the attachment a known name then you could find/replace if a new signature was supplied.

Its not a solution to the exact problem you have but will get you across the finish line…

Attribution
Source : Link , Question Author : Anil Shivaraj , Answer Author : Richard Durrant

Leave a Comment