Fixed pdf creation