Pdf validation fixes

Fix two PDF validation issues spotted by apache preflight validator. See https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1573 for more info.