From dff99b163df97214b7efa13e272e38bab913ea86 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 7 Nov 2025 13:12:01 +0100 Subject: [PATCH] refactor: simplify AddFormFieldValue method and remove redundant parameters --- .../Pdf/BurnPdfCommand.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs b/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs index 8bb3dc42..918bc99f 100644 --- a/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs +++ b/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs @@ -254,6 +254,21 @@ public class BurnPdfCommandHandler : IRequestHandler } } + private void AddFormFieldValue(double x, double y, double width, double height, int page, string value) + { + _manager.SelectPage(page); + + // Add the text annotation + var ant = _manager.AddTextAnnot((float)x, (float)y, (float)width, (float)height, value); + + // Set the font properties + ant.FontName = _pdfBurnerParams.FontName; + ant.FontSize = _pdfBurnerParams.FontSize; + ant.FontStyle = _pdfBurnerParams.FontStyle; + + _manager.SaveAnnotationsToPage(); + } + private void AddFormFieldValue(Annotation pAnnotation, FormFieldValue formFieldValue) { var ffIndex = _pdfBurnerParams.GetAnnotationIndex(pAnnotation.EgName);