Skip to content

Commit

Permalink
Fix out of range exception in AnnotationProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
BobLd committed Dec 31, 2024
1 parent b6474dd commit 366fc4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Binary file not shown.
5 changes: 3 additions & 2 deletions src/UglyToad.PdfPig/Annotations/AnnotationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ public IEnumerable<Annotation> GetAnnotations()
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);
Expand Down

0 comments on commit 366fc4f

Please sign in to comment.