diff --git a/src/UglyToad.PdfPig/Content/OptionalContentGroupElement.cs b/src/UglyToad.PdfPig/Content/OptionalContentGroupElement.cs index 33ac16de..bcc0eb52 100644 --- a/src/UglyToad.PdfPig/Content/OptionalContentGroupElement.cs +++ b/src/UglyToad.PdfPig/Content/OptionalContentGroupElement.cs @@ -68,6 +68,10 @@ internal OptionalContentGroupElement(MarkedContentElement markedContentElement, { Name = nameStr.Data; } + else if (markedContentElement.Properties.TryGet(NameToken.Name, pdfTokenScanner, out HexToken? nameHex)) + { + Name = nameHex.Data; + } else { throw new ArgumentException($"Cannot parse optional content's {nameof(Name)} from {nameof(markedContentElement.Properties)}. This is a required field.", nameof(markedContentElement.Properties));