PDFObject[] bgObjs = bgObj.getArray();
float[] bgArray = new float[bgObjs.length];
for (int i = 0; i < bgArray.length; i++) {
bgArray[i] = bgObjs[i].getFloatValue();
}
PDFPaint paint = cs.getPaint(bgArray);
shader.setBackground(paint);
}
// read the bounding box (optional)
PDFObject bboxObj = shaderObj.getDictRef("BBox");