simplify pdf code