PdfSoftMask constructor
PdfSoftMask(
- PdfDocument document, {
- required PdfRect boundingBox,
- bool isolated = false,
- bool knockout = false,
- bool invert = false,
Implementation
PdfSoftMask(this.document,
{required PdfRect boundingBox,
bool isolated = false,
bool knockout = false,
bool invert = false}) {
_mask = PdfGraphicXObject(document, '/Form');
_mask.params['/BBox'] = PdfArray.fromNum([
boundingBox.x,
boundingBox.y,
boundingBox.width,
boundingBox.height,
]);
if (isolated) {
_mask.params['/I'] = const PdfBool(true);
}
if (knockout) {
_mask.params['/K'] = const PdfBool(true);
}
_graphics = PdfGraphics(_mask, _mask.buf);
if (invert) {
_tr = PdfFunction(
document,
data: [255, 0],
);
}
}