fix pdf as output bug