PDFBOX-2020: avoid NPE if there is no colorspaces resource; minor code cleanup

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1614460 13f79535-47bb-0310-9956-ffa450edef68
PDFBOX-2020: avoid NPE if there is no colorspaces resource

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1614465 13f79535-47bb-0310-9956-ffa450edef68
PDFBOX-2247: fixed encoding issue when extracting text by taking a char offset (FirtsChar-1) into account

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