namespace DocumentService.Client.Interfaces;
///
/// Client for PDF validation operations (validate, validate PDF/A).
///
public interface IPdfValidationClient
{
///
/// Validates a PDF from stream (multipart upload).
///
/// PDF file stream
/// Cancellation token
/// Validation result with metadata
Task ValidatePdfAsync(Stream pdfStream, CancellationToken cancellationToken = default);
///
/// Validates a PDF from byte array (Base64 JSON).
///
/// PDF file as byte array
/// Cancellation token
/// Validation result with metadata
Task ValidatePdfAsync(byte[] pdfBytes, CancellationToken cancellationToken = default);
///
/// Validates a PDF/A from stream (multipart upload).
///
/// PDF/A file stream
/// Cancellation token
/// PDF/A validation result with conformance level and errors
Task ValidatePdfAAsync(Stream pdfStream, CancellationToken cancellationToken = default);
///
/// Validates a PDF/A from byte array (Base64 JSON).
///
/// PDF/A file as byte array
/// Cancellation token
/// PDF/A validation result with conformance level and errors
Task ValidatePdfAAsync(byte[] pdfBytes, CancellationToken cancellationToken = default);
}
///
/// DTO for PDF validation result
///
public record PdfValidationResult
{
/// Total number of pages in the document.
public int PageCount { get; init; }
/// File size in bytes.
public long FileSizeBytes { get; init; }
/// PDF specification version (e.g. "1.7").
public string PdfVersion { get; init; } = string.Empty;
/// Whether the document is password-protected.
public bool IsEncrypted { get; init; }
/// Whether the document contains embedded file attachments.
public bool HasAttachments { get; init; }
/// Number of embedded file attachments.
public int AttachmentCount { get; init; }
}
///
/// DTO for PDF/A validation result
///
public record PdfAValidationResult
{
/// Whether the document is fully PDF/A conformant.
public bool IsValid { get; init; }
/// Detected PDF/A conformance level (e.g. "PDF/A-3b"), or null if not a PDF/A document.
public string? PdfAVersion { get; init; }
/// Total number of pages in the document.
public int PageCount { get; init; }
/// List of conformance errors found during validation.
public List Errors { get; init; } = new();
/// List of conformance warnings found during validation.
public List Warnings { get; init; } = new();
}