I am trying to display a PDF stored in static resource and passing the blob as a string to VF page and late rendering as PDF

<apex:page controller="DataDisplayController" renderAs="pdf">
<!--<iframe src="data:application/pdf;base64,{!PDFData}" ></iframe>--> 
<!--iframe doesn't display the data  --> 

Displays only the Blob value in VF Page but I need the data from the blob

JVBERi0xLjUNJeLjz9MNCjk2IDAgb2JqIDw8L0xpbmVhcml6ZWQgMS9MIDQzNzQyNC9PIDEwNy9FID ------- Blob recieved in VF page

The string is valid UTF-8 stirng --> EncodingUtil.base64Encode(csvBlob);

How Am i supposed to display the blob data in VF page

  • 1
    You can't render a PDF in a PDF. The underlying rendering engine (Flying Saucer) does not support this sort of functionality. I'm not sure what you're trying to do, but this path is a dead end. – sfdcfox Apr 26 at 13:37
  • oh Okay, but Can I display the Blob data in VF page. Can you suggest a workaround for that? – SFDC Apr 27 at 4:51
  • You can only display certain types of Blob files, such as a PNG or JPG. You can't put in any arbitrary type. – sfdcfox Apr 27 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.