feat(BurnPdfCommandHandler): implement AddInkAnnotation for freehand annotations

- Added implementation for AddInkAnnotation(int page, string value) to render ink annotations from JSON.
- Deserialize ink lines and stroke color, convert points to PDF coordinates, and add as freehand annotations.
- Retained placeholder for AddInkAnnotation(Annotation pAnnotation) for future use.
This commit is contained in:
tekh 2025-11-07 13:21:33 +01:00
parent e21eb2c0d6
commit b20d25e5b9

View File

@ -329,7 +329,23 @@ public class BurnPdfCommandHandler : IRequestHandler<BurnPdfCommand>
private void AddInkAnnotation(int page, string value)
{
throw new NotImplementedException();
var ink = JsonConvert.DeserializeObject<Ink>(value);
var oSegments = ink?.Lines.Points;
var oColor = ColorTranslator.FromHtml(ink?.StrokeColor ?? "#000000");
_manager.SelectPage(page);
if (oSegments is null)
return;
foreach (var oSegment in oSegments)
{
var oPoints = oSegment
.Select(ToPointF)
.ToArray();
_manager.AddFreeHandAnnot(oColor, oPoints);
}
}
private void AddInkAnnotation(Annotation pAnnotation)