Thank you.
I am not getting any errors, but the warning - 'Use of uninitialized value in numeric gt (>) at /usr/local/share/perl/5.10.0/PDF/API2/Basic/TTF/Cmap.pm line 258.'
But when I am using a ttf font, it works fine. The problem is with only the otf font. The pdf is being created. But when I open that pdf, it gets closed immediately. And no thumbnail preview available of that pdf file.