I was using 'evince' to open the created pdf. As I told earlier, it was immediately closing then itself. In the terminal it showed the error "Error: Mismatch between font type and embedded font file". When I am opening it in Adobe Reader, it opens fine. No problem at all.
Thank you.