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! Link to comment https://forums.phpfreaks.com/topic/56778-decode-base64-pdf-file/ Share on other sites More sharing options...
chigley Posted June 22, 2007 Share Posted June 22, 2007 base64_decode()? Link to comment https://forums.phpfreaks.com/topic/56778-decode-base64-pdf-file/#findComment-280411 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!!! Link to comment https://forums.phpfreaks.com/topic/56778-decode-base64-pdf-file/#findComment-280427 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)); Link to comment https://forums.phpfreaks.com/topic/56778-decode-base64-pdf-file/#findComment-811428 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.