Possibility to set CreationDate and ModifiedDate in DocumentInformationBuilder

This commit is contained in:
Alejandro 2023-04-01 13:06:14 +02:00 committed by BobLd
parent bd4eedfcac
commit 2e0622b652

View File

@ -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;
}
}