fix(BurnPdfCommand): improve JSON serialization and null safety in Signature entity and BurnPdfCommandHandler
- Added System.Text.Json.Serialization namespace and [JsonIgnore] attributes to Top and Left properties in Signature entity for .NET builds - Applied null-forgiving operator (!) and null-coalescing defaults for frame.X and frame.Y in BurnPdfCommandHandler - Improved runtime safety and prevented unintended JSON serialization of computed properties
This commit is contained in:
@@ -43,6 +43,13 @@ public class BurnPdfCommandHandler : IRequestHandler<BurnPdfCommand>
|
||||
_signRepo = signRepo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="pSourceBuffer"></param>
|
||||
/// <param name="pInstantJSONList"></param>
|
||||
/// <param name="envelopeId"></param>
|
||||
/// <returns></returns>
|
||||
public byte[] BurnAnnotsToPDF(byte[] pSourceBuffer, List<string> pInstantJSONList, int envelopeId)
|
||||
{
|
||||
// read the elements of envelope with their annotations
|
||||
@@ -99,10 +106,10 @@ public class BurnPdfCommandHandler : IRequestHandler<BurnPdfCommand>
|
||||
|
||||
var frame = element.Annotations?.FirstOrDefault(a => a.Name == "frame");
|
||||
double frameY = element.Top - 0.5 - margin;
|
||||
double frameYShift = frame.Y - frameY * inchFactor;
|
||||
double frameXShift = frame.X - frameX * inchFactor;
|
||||
double frameYShift = (frame!.Y ?? default) - frameY * inchFactor;
|
||||
double frameXShift = (frame.X ?? default) - frameX * inchFactor;
|
||||
|
||||
foreach (var annot in element.Annotations)
|
||||
foreach (var annot in element.Annotations!)
|
||||
{
|
||||
double yOffsetofFF;
|
||||
if (!yOffsetsOfFF.TryGetValue(annot.Name, out yOffsetofFF))
|
||||
|
||||
Reference in New Issue
Block a user