Jump to content

decode a hex to pdf file


rkutti

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.