I want to embed a pdf in a VF site.

I'm using the "object, embed" method and that works fine for a VF page, however when attempting to make that page externally available via a site, the pdf is no longer available.

Is this a limitation, or do I have the profile permissions incorrect?



Yes you can embed a PDF in a VF page via a data URI. For example...

 <apex:page controller="myPDF" sidebar="false" contentType="application/pdf">
      window.location.href = "data:application/pdf;base64,{!myData}";

You will need to test on different browsers. Note that you need the base64 encoded data.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.