Fix out of range exception in AnnotationProvider

This commit is contained in:
BobLd 2024-12-31 10:32:00 +00:00
parent b6474dda4c
commit 366fc4fe04
2 changed files with 3 additions and 2 deletions

View File

@ -92,9 +92,10 @@
var width = borderArray.GetNumeric(2).Data;
var dashes = default(IReadOnlyList<double>);
if (borderArray.Length == 4 && borderArray.Data[4] is ArrayToken dashArray)
if (borderArray.Length == 4 && borderArray.Data[3] is ArrayToken dashArray)
{
dashes = dashArray.Data.OfType<NumericToken>().Select(x => x.Data).ToList();
// PDFBOX-624-2.pdf
dashes = dashArray.Data.OfType<NumericToken>().Select(x => x.Data).ToArray();
}
border = new AnnotationBorder(horizontal, vertical, width, dashes);