+ Start a Discussion
Salesforce 283Salesforce 283 

How to display pdf file from document object in visualforce PDF

Hi Guys,
I have one PDF page in that i want to display 10 pages of PDF document in Visualforce PDF. Actually that 10 pages of document changes often. So PDF doc put in document obj and display in VF PDF. Actually i can take separate page(without renderas) for PDF which is stored in document that is showed but whenever i put in VF PDF it's not getting. Please help me out this problem.
Script tag is not working in VF PDF. Could u pls suggest another solution.

        window.location.href = "data:application/pdf;base64,{!pdfdoc}";

Apex Class:
 public Classname(){
    doc = [SELECT id, Body, ContentType, Name FROM document where id='XXXXXXXXXXXXX'];
    public string pdfdoc {
    get {
    return EncodingUtil.Base64Encode(doc[0].body);
Andy BoettcherAndy Boettcher
Read through this link and see if this helps you out:  https://developer.salesforce.com/forums/?id=906F000000094g9IAA