Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/PdfSharp/Pdf/PdfOutline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,10 @@ void SplitDestinationPage(PdfArray destination) // Reference: 8.2 Destination s
#pragma warning disable 162

// The destination page may not yet have been transformed to PdfPage.
PdfDictionary destPage = (PdfDictionary)((PdfReference)destination.Elements[0]).Value;
PdfDictionary destPage = (destination.Elements[0] is PdfInteger) ?
destination.Owner.Pages[((PdfInteger)destination.Elements[0]).Value] :
(PdfDictionary)((PdfReference)destination.Elements[0]).Value;

PdfPage page = destPage as PdfPage;
if (page == null)
page = new PdfPage(destPage);
Expand Down