compwhizmm Posted June 22, 2007 Share Posted June 22, 2007 Hi, I'm trying to work on a script that can decode an encoded pdf file from xml. I have the xml in a variable called $result. Inside that xml there is code for the pdf. It is encoded in base64. My question is how can I pull the data from the xml, decode it, and display the pdf file that it is. Thank you! Quote Link to comment Share on other sites More sharing options...
chigley Posted June 22, 2007 Share Posted June 22, 2007 base64_decode()? Quote Link to comment Share on other sites More sharing options...
compwhizmm Posted June 22, 2007 Author Share Posted June 22, 2007 I have tried that, but the page comes up blank. I'm not sure how to make it display as a pdf. Also, I'm not sure if i'm pulling the variables from the xml correctly. Here is a sample of my xml. <xmlsample><pdffile>Encoded pdf data</pdffile></xmlsample> The above is in a variable called $result. I tried to pull it out like this $result['pdffile'] Is that correct? I need to pull the encoded pdf data out, decode it, then display it as a pdf. Thanks or any help!!! Quote Link to comment Share on other sites More sharing options...
chandresh_jit Posted April 16, 2009 Share Posted April 16, 2009 u can use: header("Content-type: application/pdf"); echo ((base64_decode($result)); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.