improved pdf conversion