Hex to image in PHP
Any other way to create the image from hexadecimal number? I use a signature pad to get the signature and save it as an image and put in a PDF; I have created the image (*.PNG) from the hex code(signiture pad generates the HExadecimal number); the image seems fine (I can open it and see it!), but for some reason this image cannot be put in the PDF by FPDF; however I can put any other images to my PDF by using FPDF; so I guess there is a problem with the image I created (HEX to Image). I created my image by the following code:
$binary = pack("H*", $MyHex);
file_put_contents("../img/Sign_Representative.png", $binary);
Do you know any other way I can create the image from HEX or any way I can handle this problem?
I appreciate your guidance!
Answer
Solution:
Are you sure that signature pad provides PNG-data in HEX?
Check generated file's content if the first row contains letters "PNG" (without quotes).
Tried yours and following and all provided data correctly back:
btw, what kind/model signature pad you have? i.e. Honeywell TT8500?