mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-21 03:14:06 +08:00
Possibility to set CreationDate and ModifiedDate in DocumentInformationBuilder
This commit is contained in:
@@ -992,6 +992,16 @@ namespace UglyToad.PdfPig.Writer
|
||||
/// </summary>
|
||||
public string Producer { get; set; } = "PdfPig";
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="DocumentInformation.CreationDate"/>.
|
||||
/// </summary>
|
||||
public string CreationDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="DocumentInformation.ModifiedDate"/>.
|
||||
/// </summary>
|
||||
public string ModifiedDate { get; set; }
|
||||
|
||||
internal Dictionary<NameToken, IToken> ToDictionary()
|
||||
{
|
||||
var result = new Dictionary<NameToken, IToken>();
|
||||
@@ -1026,6 +1036,16 @@ namespace UglyToad.PdfPig.Writer
|
||||
result[NameToken.Producer] = new StringToken(Producer);
|
||||
}
|
||||
|
||||
if (CreationDate != null)
|
||||
{
|
||||
result[NameToken.CreationDate] = new StringToken(CreationDate);
|
||||
}
|
||||
|
||||
if (ModifiedDate != null)
|
||||
{
|
||||
result[NameToken.ModDate] = new StringToken(ModifiedDate);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user