changed pdf class to open the pdf it creates after creation

changed pdf class to open the pdf it creates after creation