Barcode is not getting generated properly in

I have taken reference from HERE for generating barcode. I have gone through the code but what issue happening to me is. its simply generating a PNG image but not with the black and whiteline.

here is what is generates.


do let me know where I am going wrong.