refactor: simplify AddFormFieldValue method and remove redundant parameters

This commit is contained in:
tekh 2025-11-07 13:12:01 +01:00
parent 70fbf31b14
commit dff99b163d

View File

@ -254,6 +254,21 @@ public class BurnPdfCommandHandler : IRequestHandler<BurnPdfCommand>
} }
} }
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) private void AddFormFieldValue(Annotation pAnnotation, FormFieldValue formFieldValue)
{ {
var ffIndex = _pdfBurnerParams.GetAnnotationIndex(pAnnotation.EgName); var ffIndex = _pdfBurnerParams.GetAnnotationIndex(pAnnotation.EgName);