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:
parent
e21eb2c0d6
commit
b20d25e5b9
@ -329,7 +329,23 @@ public class BurnPdfCommandHandler : IRequestHandler<BurnPdfCommand>
|
|||||||
|
|
||||||
private void AddInkAnnotation(int page, string value)
|
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)
|
private void AddInkAnnotation(Annotation pAnnotation)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user