Refactor DTOs and simplify PdfDigitalSignatureService
Refactored `PdfSignOptionsDto` and `PdfVisualSignatureOptionsDto`: - Converted both to immutable `record` types with non-nullable properties. - Added XML documentation comments for properties and parameters. Simplified `PdfDigitalSignatureService`: - Updated `SignPdfAsync` to enforce non-nullable `PdfSignOptionsDto`. - Removed redundant null checks and inlined `CreateSignatureBounds`. - Simplified signature appearance and image data logic. - Refactored `TryGetKeySize` to use `bool` with `out` parameter. General improvements: - Enhanced code readability and maintainability. - Reduced nullable references and enforced stricter type safety.
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="ImageBytes"></param>
|
||||
/// <param name="PageNumber"></param>
|
||||
/// <param name="Left"></param>
|
||||
/// <param name="Bottom"></param>
|
||||
/// <param name="Width"></param>
|
||||
/// <param name="Height"></param>
|
||||
/// <param name="ShowLabels"></param>
|
||||
public sealed record PdfVisualSignatureOptionsDto(
|
||||
byte[] ImageBytes,
|
||||
int PageNumber,
|
||||
|
||||
Reference in New Issue
Block a user