Commit Graph

6 Commits

Author SHA1 Message Date
522de8a863 feat: Add IPdfProcessor.MergePdfsAsync interface
- Add MergePdfsAsync method to IPdfProcessor interface
- Parameters: IReadOnlyList<Stream> pdfStreams, IReadOnlyList<string?>? pageRanges
- Returns: Task<byte[]> (merged PDF)
- Validates: Minimum 2 PDFs, stream Position = 0, page ranges count matches PDF count
- Supports optional page ranges (e.g., '1-3,5' or null for all pages)
2026-07-21 10:20:18 +02:00
2c673ea98e feat: Add IPdfProcessor.ExtractAttachmentsAsync interface method 2026-07-21 09:26:11 +02:00
5dc2e38507 refactor(application): update processor interfaces for Stream API
- IPdfProcessor: ValidateAsync, ValidatePdfAAsync, CheckAttachmentsAsync now accept Stream
- ISwissQrCodeProcessor: ExtractSwissQrCodeAsync now accepts Stream
- Update XML documentation: Position=0 requirement, non-seekable stream support
- Exception documentation: BadRequestException for validation errors (stream empty/invalid/wrong position)
2026-07-20 16:31:31 +02:00
73a7afe257 refactor: Change IPdfProcessor interface from byte[] to Stream
- ValidateAsync(byte[]) → ValidateAsync(Stream)
- ValidatePdfAAsync(byte[]) → ValidatePdfAAsync(Stream)
- CheckAttachmentsAsync(byte[]) → CheckAttachmentsAsync(Stream)
- Reason: Stream-based processing reduces memory footprint and enables pipeline parallelization
2026-07-20 11:55:08 +02:00
cd50d45bd5 feat: Add PDF/A validation endpoint (Feature 3)
Domain layer:

  - PdfAMetadata value object (isValid, pdfVersion, pageCount, encrypted, pdfaVersion, pdfaCompliant, errors, warnings)

Infrastructure layer:

  - IPdfProcessor.ValidatePdfAAsync() interface method

  - DevExpressPdfProcessor.ValidatePdfAAsync() implementation

  - DetectEncryption() - scans PDF raw data for /Encrypt keyword

  - DetectPdfAConformance() - parses XMP metadata (pdfaid:part, pdfaid:conformance)

  - Validation: encrypted PDF cannot be PDF/A compliant

Application layer:

  - ValidatePdfAQuery + ValidatePdfAQueryHandler (co-located)

  - ValidatePdfAQueryValidator (FluentValidation: PdfBytes XOR Base64Pdf)

  - PdfAValidationResult DTO

  - AutoMapper: PdfAMetadata -> PdfAValidationResult

API layer:

  - PdfValidationController.ValidatePdfAFromFile() (multipart/form-data)

  - PdfValidationController.ValidatePdfAFromBase64() (application/json)

  - XML documentation with response codes

Result:

  - POST /api/pdf/validation/validate-pdfa (both multipart and JSON)

  - Returns: conformance level, errors, warnings

  - Build: 0 errors, 4 warnings (DevExpress eval)

  - Tests: 20/20 passing

Next: Integration tests + Swagger test case
2026-07-09 12:59:24 +02:00
OlgunR
49d1f43822 Add IPdfProcessor interface and update ROADMAP.md
The `IPdfProcessor` interface was added to the `Application/Common/Interfaces/` directory. It includes the `ValidateAsync` method for validating PDFs and extracting metadata, with proper XML documentation and dependency on domain value objects.

Updated `ROADMAP.md` to mark Step 3.1 as completed, detailing the creation of the `IPdfProcessor` interface and its implementation status.

Removed the `<Folder Include="Common\Interfaces\" />` entry from `DocumentOperator.Application.csproj` to reflect the transition from a placeholder folder structure to actual implementation.
2026-06-18 16:02:32 +02:00