rkutti Posted April 8, 2010 Share Posted April 8, 2010 Hi, I have a pdf file content in hex encoded format. I want to decode that pdf file. Is there any php code or tool available to do this decoding. I used the following function to decode the hex content to pdf and tried to open the pdf file, it throws error. function hexToStr($hex) { $string=''; for ($i=0; $i < strlen($hex)-1; $i+=2) { $string .= chr(hexdec($hex[$i].$hex[$i+1])); } return $string; } Please help me to decode a hex value to pdf file. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/197981-decode-a-hex-to-pdf-file/ Share on other sites More sharing options...
salathe Posted April 8, 2010 Share Posted April 8, 2010 It will probably be helpful to take a peek at pack (likely using H* or h* depending on the 'hex encoded format'). Link to comment https://forums.phpfreaks.com/topic/197981-decode-a-hex-to-pdf-file/#findComment-1038923 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.