Update PDF metadata handling in PdfResultPackageService

Introduce functionality to remove and replace metadata in the
resulting PDF document. After loading the document with
`PdfDocumentProcessor`, the metadata fields (`Author`, `Creator`,
`Producer`, `Title`, `Subject`, and `Keywords`) are cleared or
replaced with values indicating the document was processed by
the "DXApp" system. This ensures proper attribution and removes
any association with the original document creator.
This commit is contained in:
OlgunR
2026-06-01 16:32:25 +02:00
parent a4c33e6bac
commit 2ae2bbdaf6

View File

@@ -60,6 +60,14 @@ public class PdfResultPackageService(
using var processor = new PdfDocumentProcessor(); using var processor = new PdfDocumentProcessor();
processor.LoadDocument(convertedStream); processor.LoadDocument(convertedStream);
// Metadaten des Originals entfernen → Result-PDF gehört uns, nicht dem Ersteller
processor.Document.Author = "DXApp Verarbeitungssystem";
processor.Document.Creator = "DXApp";
processor.Document.Producer = "DXApp";
processor.Document.Title = string.Empty;
processor.Document.Subject = string.Empty;
processor.Document.Keywords = string.Empty;
processor.AttachFile(new PdfFileAttachment processor.AttachFile(new PdfFileAttachment
{ {
FileName = Path.GetFileName(reportPath), FileName = Path.GetFileName(reportPath),