Add ZUGFeRD Guideline-ID extraction and display

Enhanced `PdfExtractionResult` with a new `ZugferdGuidelineId` property to store the ZUGFeRD Guideline-ID extracted from XMP metadata. Updated `Upload.cshtml` to display this information in the UI if available.

Implemented ZUGFeRD Guideline-ID extraction in `PdfAttachmentExtractorService` using a new helper method `ExtractGuidelineId`, which parses XMP metadata for known prefixes. Added logging for extracted Guideline-IDs and improved error handling with a `try-catch` block for metadata processing.

Fixed `FileAttachments` handling in `PdfAttachmentExtractorService` by converting to `List<T>` for proper `Count` property usage.
This commit is contained in:
OlgunR
2026-05-26 17:05:52 +02:00
parent 42d4222fb3
commit 6a46bf4f4b
3 changed files with 60 additions and 0 deletions

View File

@@ -17,6 +17,11 @@ public class PdfExtractionResult
// Soll eine Warnung angezeigt werden?
// true wenn kein PDF/A → ZUGFeRD-Rechnungen müssen PDF/A-3b sein
public bool PdfAWarning { get; set; }
// ZUGFeRD Guideline-ID aus XMP-Metadaten
// Beispiel: "urn:ferd:invoice:rc:comfort"
// Leer wenn keine ZUGFeRD-Metadaten gefunden
public string ZugferdGuidelineId { get; set; } = string.Empty;
}
public class ExtractedAttachment