use of com.tom_roush.pdfbox.pdmodel.graphics.form.PDTransparencyGroup in project PdfBox-Android by TomRoush.
the class DrawObject method process.
@Override
public void process(Operator operator, List<COSBase> operands) throws IOException {
if (operands.isEmpty()) {
throw new MissingOperandException(operator, operands);
}
COSBase base0 = operands.get(0);
if (!(base0 instanceof COSName)) {
return;
}
COSName objectName = (COSName) base0;
PDXObject xobject = context.getResources().getXObject(objectName);
if (xobject == null) {
throw new MissingResourceException("Missing XObject: " + objectName.getName());
} else if (xobject instanceof PDImageXObject) {
PDImageXObject image = (PDImageXObject) xobject;
context.drawImage(image);
} else if (xobject instanceof PDFormXObject) {
try {
context.increaseLevel();
if (context.getLevel() > 25) {
Log.e("PdfBox-Android", "recursion is too deep, skipping form XObject");
return;
}
PDFormXObject form = (PDFormXObject) xobject;
if (form instanceof PDTransparencyGroup) {
context.showTransparencyGroup((PDTransparencyGroup) form);
} else {
context.showForm(form);
}
} finally {
context.decreaseLevel();
}
}
}
Aggregations