PDFBOX-1702: added some improvements based on a proposal by Philip Helger

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1517288 13f79535-47bb-0310-9956-ffa450edef68