Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
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 @@ -512,7 +512,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 (Options.ManualXmpGeneration == false)
Catalog.Elements.SetReference(PdfCatalog.Keys.Metadata, new PdfMetadata(this));
}

/// <summary>
Expand Down
12 changes: 12 additions & 0 deletions src/foundation/src/PDFsharp/src/PdfSharp/Pdf/PdfDocumentOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,17 @@ public PdfWriterLayout Layout
#else
PdfWriterLayout _writerLayout = PdfWriterLayout.Compact;
#endif

/// <summary>
/// Gets or sets a value indicating whether XMP metadata will be generated manually.
/// true (manual): XMP metadata has to be built and attached manually via <see cref="PdfMetadata"/> class.
/// false (auto): XMP metadata will be built and attached automatically.
/// </summary>
public bool ManualXmpGeneration
{
get => _manualXmpGeneration;
set => _manualXmpGeneration = value;
}
bool _manualXmpGeneration = false;
}
}