namespace DocumentService.Client.Models.Requests; /// /// Request DTO for the PDF digital-signing endpoint (JSON payload). /// public sealed record SignPdfRequest { /// /// Base64-encoded PDF to sign. /// public required string Base64Pdf { get; init; } /// /// Optional Base64-encoded signature image (PNG/JPEG). /// public string? Base64SignatureImage { get; init; } /// /// Signing options (metadata + appearance). /// public required SignPdfOptions Options { get; init; } } /// /// Signing metadata and appearance options. /// public sealed record SignPdfOptions { /// /// Document element id embedded into the signature metadata. /// public long DocumentElementId { get; init; } /// /// Signer name. /// public required string Name { get; init; } /// /// Signing reason. /// public string? Reason { get; init; } /// /// Signing location. /// public string? Location { get; init; } /// /// Signer email (optional contact info). /// public string? Email { get; init; } /// /// Signer phone (optional contact info). /// public string? Phone { get; init; } /// /// Application name embedded into the signature metadata. /// public string? ApplicationName { get; init; } /// /// Certification level applied to the signature. /// public PdfSignatureCertificationLevel CertificationLevel { get; init; } /// /// Optional visual appearance of the signature field. /// public PdfSignatureAppearance? Appearance { get; init; } } /// /// Visual appearance of the signature field. /// public sealed record PdfSignatureAppearance { /// /// Page number (1-based) where the signature is placed. /// public int PageNumber { get; init; } /// /// Left bound of the signature field. /// public double Left { get; init; } /// /// Bottom bound of the signature field. /// public double Bottom { get; init; } /// /// Width of the signature field. /// public double Width { get; init; } /// /// Height of the signature field. /// public double Height { get; init; } public bool ShowLabels { get; init; } public bool ShowName { get; init; } public bool ShowDate { get; init; } public bool ShowReason { get; init; } public bool ShowLocation { get; init; } public bool ShowDistinguishedName { get; init; } /// /// Date/time format used in the signature appearance. /// public string DateTimeFormat { get; init; } = "dd.MM.yyyy HH:mm:ss zzz"; /// /// Coordinate unit of the signature bounds. /// public PdfSignatureCoordinateUnit CoordinateUnit { get; init; } = PdfSignatureCoordinateUnit.Point; /// /// Coordinate origin of the signature bounds. /// public PdfSignatureCoordinateOrigin CoordinateOrigin { get; init; } = PdfSignatureCoordinateOrigin.BottomLeft; /// /// Font settings of the signature appearance. /// public PdfSignatureFont Font { get; init; } = new(); } /// /// Font settings of the signature appearance. /// public sealed record PdfSignatureFont { public string FamilyName { get; init; } = "Helvetica"; public float Size { get; init; } = 10; public bool IsBold { get; init; } public bool IsItalic { get; init; } public bool IsUnderline { get; init; } public PdfSignatureColor Color { get; init; } = new(); } /// /// RGB color (0-255 channels) of the signature appearance font. /// public sealed record PdfSignatureColor { public double R { get; init; } public double G { get; init; } public double B { get; init; } } /// /// Certification level of the PDF signature. /// public enum PdfSignatureCertificationLevel { /// All changes are allowed. NoCertification = 0, /// No changes are allowed. NoChangesAllowed, /// Allows form filling and signing. FillForms, /// Allows form filling, annotation and signing. FillFormsAndAnnotate } /// /// Coordinate unit of the signature bounds. /// public enum PdfSignatureCoordinateUnit { Point = 0, Inch = 1 } /// /// Coordinate origin of the signature bounds. /// public enum PdfSignatureCoordinateOrigin { BottomLeft = 0, TopLeft = 1 }