Reverted change of ModifiedDate (from string to DateTimeOffset) since

according to the PDF reference guide this field can contain anything.
This commit is contained in:
mvantzet 2023-03-14 12:01:24 +01:00
parent 9ff095c516
commit 048caedd64
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@
/// The date and time the annotation was last modified, can be in any format. Optional.
/// </summary>
[CanBeNull]
public DateTimeOffset ModifiedDate { get; }
public string ModifiedDate { get; }
/// <summary>
/// Flags defining the appearance and behaviour of this annotation.
@ -79,7 +79,7 @@
/// <summary>
/// Create a new <see cref="Annotation"/>.
/// </summary>
public Annotation(DictionaryToken annotationDictionary, AnnotationType type, PdfRectangle rectangle, string content, string name, DateTimeOffset modifiedDate,
public Annotation(DictionaryToken annotationDictionary, AnnotationType type, PdfRectangle rectangle, string content, string name, string modifiedDate,
AnnotationFlags flags, AnnotationBorder border, IReadOnlyList<QuadPointsQuadrilateral> quadPoints,
StreamToken normalAppearanceStream, StreamToken rollOverAppearanceStream, StreamToken downAppearanceStream)
{

View File

@ -44,8 +44,8 @@
var contents = GetNamedString(NameToken.Contents, annotationDictionary);
var name = GetNamedString(NameToken.Nm, annotationDictionary);
var modifiedDateAsString = GetNamedString(NameToken.M, annotationDictionary);
if (!DateFormatHelper.TryParseDateTimeOffset(modifiedDateAsString, out var modifiedDate)) modifiedDate = default(DateTimeOffset);
// As indicated in PDF reference 8.4.1, the modified date can be anything, but is usually a date formatted according to sec. 3.8.3
var modifiedDate = GetNamedString(NameToken.M, annotationDictionary);
var flags = (AnnotationFlags)0;
if (annotationDictionary.TryGet(NameToken.F, out var flagsToken) && DirectObjectFinder.TryGet(flagsToken, tokenScanner, out NumericToken flagsNumericToken))