use of org.apache.pdfbox.pdmodel.graphics.image.PDInlineImage in project pdfbox by apache.
the class PreflightType3Stream method processOperator.
/**
* This is used to handle an operation.
*
* @param operator
* The operation to perform.
* @param operands
* The list of arguments.
*
* @throws IOException
* If there is an error processing the operation.
*/
@Override
protected void processOperator(Operator operator, List<COSBase> operands) throws IOException {
super.processOperator(operator, operands);
String operation = operator.getName();
if (operation.equals("BI")) {
image = new PDInlineImage(operator.getImageParameters(), operator.getImageData(), getResources());
validateInlineImageFilter(operator);
validateInlineImageColorSpace(operator);
}
if (operation.equals("d0")) {
checkType3FirstOperator(operands);
} else if (operation.equals("d1")) {
COSNumber llx = (COSNumber) operands.get(2);
COSNumber lly = (COSNumber) operands.get(3);
COSNumber urx = (COSNumber) operands.get(4);
COSNumber ury = (COSNumber) operands.get(5);
box = new BoundingBox();
box.setLowerLeftX(llx.floatValue());
box.setLowerLeftY(lly.floatValue());
box.setUpperRightX(urx.floatValue());
box.setUpperRightY(ury.floatValue());
checkType3FirstOperator(operands);
}
checkColorOperators(operation);
validateRenderingIntent(operator, operands);
checkSetColorSpaceOperators(operator, operands);
validateNumberOfGraphicStates(operator);
firstOperator = false;
}
use of org.apache.pdfbox.pdmodel.graphics.image.PDInlineImage in project pdfbox by apache.
the class BeginInlineImage method process.
@Override
public void process(Operator operator, List<COSBase> operands) throws IOException {
if (operator.getImageData() == null || operator.getImageData().length == 0) {
return;
}
PDImage image = new PDInlineImage(operator.getImageParameters(), operator.getImageData(), context.getResources());
context.drawImage(image);
}
Aggregations