- Updated BurnPdfCommandHandler constructor to accept IOptions<PDFBurnerParams> instead of raw PDFBurnerParams. - Updated AddFormFieldValue to calculate coordinates based on PDFBurnerParams offsets and margins. - Added helper methods for converting pixels to inches (ToInches, ToPointF). - Removed unused NotImplemented methods in AddFormFieldValue overload. - Improved code readability and maintainability for annotation burning logic.
60 lines
1.2 KiB
C#
60 lines
1.2 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
using System.Drawing;
|
|
|
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class PDFBurnerParams
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public IEnumerable<string> IgnoredLabels { get; set; } = new List<string>
|
|
{
|
|
"Date", "Datum", "ZIP", "PLZ", "Place", "Ort", "Position", "Stellung"
|
|
};
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
|
|
public double TopMargin { get; set; } = 0.1;
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public double YOffset { get; set; } = -0.3;
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public string FontName { get; set; } = "Arial";
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public int FontSize { get; set; } = 8;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")]
|
|
public FontStyle FontStyle { get; set; } = FontStyle.Italic;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public Dictionary<string, int> IndexOfAnnot { get; init; } = new()
|
|
{
|
|
{ string.Empty, 0 },
|
|
{ "seal", 0 },
|
|
{ "position", 1 },
|
|
{ "city", 2 },
|
|
{ "date", 3 }
|
|
};
|
|
} |