Add interfaces and DTOs for PDF operations support
Introduced multiple interfaces and DTOs to support a wide range of PDF-related operations, including attachment handling, conversion, validation, annotation, stamping, and metadata extraction. Key changes: - Added `DocumentServiceClientOptions` for HTTP client config. - Introduced `IPdfAttachmentClient` for attachment operations. - Added `IPdfConversionClient` for PDF/A conversion (marked obsolete). - Added `IPdfOperationsClient` for merge, annotate, and stamp ops. - Introduced `IPdfValidationClient` for PDF and PDF/A validation. - Added `ISwissQrCodeClient` for Swiss QR Code extraction. - Added `IZugferdClient` for ZUGFeRD detection and extraction. - Created request DTOs for Base64-encoded operations. - Added enums for annotation, stamp, and validation configurations. These changes provide a flexible and extensible foundation for interacting with PDF documents, supporting both multipart and Base64-encoded inputs, and ensuring type safety with enums and records.
This commit is contained in:
36
DocumentService.Client/Interfaces/ISwissQrCodeClient.cs
Normal file
36
DocumentService.Client/Interfaces/ISwissQrCodeClient.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace DocumentService.Client.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Client for Swiss QR Code extraction operations.
|
||||
/// </summary>
|
||||
public interface ISwissQrCodeClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Extracts Swiss QR Code from PDF (multipart).
|
||||
/// </summary>
|
||||
/// <param name="pdfStream">PDF file stream</param>
|
||||
/// <param name="raw">If true, returns raw QR text lines instead of parsed Bill object</param>
|
||||
/// <param name="cancellationToken">Cancellation token</param>
|
||||
/// <returns>Swiss QR Code extraction result</returns>
|
||||
Task<SwissQrCodeExtractionResult> ExtractSwissQrCodeAsync(Stream pdfStream, bool raw = false, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Extracts Swiss QR Code from PDF (Base64).
|
||||
/// </summary>
|
||||
/// <param name="pdfBytes">PDF file as byte array</param>
|
||||
/// <param name="raw">If true, returns raw QR text lines instead of parsed Bill object</param>
|
||||
/// <param name="cancellationToken">Cancellation token</param>
|
||||
/// <returns>Swiss QR Code extraction result</returns>
|
||||
Task<SwissQrCodeExtractionResult> ExtractSwissQrCodeAsync(byte[] pdfBytes, bool raw = false, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DTO for Swiss QR Code extraction result
|
||||
/// </summary>
|
||||
public record SwissQrCodeExtractionResult
|
||||
{
|
||||
/// <summary>Parsed Swiss QR bill object. <c>null</c> when <c>raw=true</c> was requested.</summary>
|
||||
public object? Bill { get; init; }
|
||||
/// <summary>Raw QR code text lines. Populated when <c>raw=true</c> was requested.</summary>
|
||||
public List<string> RawLines { get; init; } = new();
|
||||
}
|
||||
Reference in New Issue
Block a user