Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
do not replace existing XMP metadata if any
we should not simply replace and lose existing XMP metadata if any already set
  • Loading branch information
julienrffr committed Oct 16, 2023
commit b9932dd4fd6de355f299c3661fb41f0d958e28d8
3 changes: 2 additions & 1 deletion src/foundation/src/PDFsharp/src/PdfSharp/Pdf/PdfDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ internal override void PrepareForSave()

// @PDF/UA
// Create PdfMetadata now to include the final document information in XMP generation.
Catalog.Elements.SetReference(PdfCatalog.Keys.Metadata, new PdfMetadata(this));
if (!Catalog.Elements.ContainsKey(PdfCatalog.Keys.Metadata) || Catalog.Elements.GetReference(PdfCatalog.Keys.Metadata) == null)
Catalog.Elements.SetReference(PdfCatalog.Keys.Metadata, new PdfMetadata(this));
}

/// <summary>
Expand Down