I'm using SkiaSharp to print labels to PDF (and other things). Each page of the PDF can have multiple rows and columns. I need to clip each label to the correct size so it's doesn't trash neighbouring labels.
For testing, each label has a rectangle that extends too far plus 7 lines of text and a circle near the vertical middle.
My code is like:
using (var region = new SKRegion())
{
region.SetRect(_labelClipRect);
_currentCanvas.ClipRegion(region, SKClipOperation.Intersect);
_labelView.Draw(_currentCanvas, _printRequest.Device.DPI, xOffsetPX, yOffsetPX);
}
The result is: The first label on each page looks correct but the rest are funky. The rectangle and circle are missing and the text is not clipped at all.
Anyone seen/got a sample of something like this?
Thanks