Replaced the fully qualified reference to
`DocumentService.Application.Common.DTOs.PdfValidationResult.IsValid`
with the simpler `PdfValidationResult.IsValid`.
Added a `TryExtract` method to the `SwissQrCodeResult` record to
improve code readability and usability. The method follows the
standard `TryXxx` pattern, allowing for an `if/else` branch
instead of a direct null-check on the `QrCode` property. It
returns `true` if the PDF was valid and a Swiss QR Code was
successfully extracted, and `false` otherwise.
Refactored `ExtractSwissQrCodeAsync` to `InspectSwissQrCodeAsync`, introducing `SwissQrCodeResult` to encapsulate both validation and extraction results. Removed `throwIfInvalid` parameter, ensuring validation details are always returned without exceptions. Added extension methods for file path handling to improve usability.
Updated tests to reflect the new behavior, ensuring extraction is never attempted on invalid documents and validation results are always populated. Simplified API surface by removing redundant overloads and improving stream handling. Enhanced documentation and performed general code cleanup for better maintainability.
Consolidated DTOs under `DocumentService.Application.Common.DTOs.Requests`
to centralize and align them with the application layer. Introduced
`PdfBase64RequestBase` to encapsulate shared properties, reducing
redundancy across request DTOs. Updated controllers, clients, and tests
to use the new DTO structure. Removed redundant DTOs and cleaned up
unused namespaces and comments. Improved documentation and ensured
consistent naming conventions across the codebase.
The `AddAttachmentsRequest` record has been removed. This record was previously used as a request DTO for adding attachments to a Base64-encoded PDF. It included a `Base64Pdf` property for the PDF document and an `Attachments` property for the list of attachments to embed.
The `ExtractPdfAttachmentsRequest` and `AttachmentRequestDto` records remain unchanged.
Enabled multi-targeting in `DocumentService.Application` to support `net462`, `net480`, and `net8.0`. Updated dependencies with framework-specific versions and added conditional configurations for compatibility.
Refactored `DocumentService.Client` by removing redundant enums and unused code. Adjusted namespaces and project references to streamline the codebase and improve maintainability.
These changes modernize the project, enhance compatibility, and align with modular design principles.
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.