private float[][] getPathArray(PDAnnotationPolygon annotation) { // PDF 2.0: Path takes priority over Vertices float[][] pathArray = annotation.getPath(); if (pathArray == null) { // convert PDF 1.* array to PDF 2.0 array float[] verticesArray = annotation.getVertices(); if (verticesArray == null) { return null; } int points = verticesArray.length / 2; pathArray = new float[points][2]; for (int i = 0; i < points; ++i) { pathArray[i][0] = verticesArray[i * 2]; pathArray[i][1] = verticesArray[i * 2 + 1]; } } return pathArray; }