PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Sort Outlines Alphabetically
http://forum.pdfsharp.com/viewtopic.php?f=2&t=4363
Page 1 of 1

Author:  sayst [ Thu Aug 25, 2022 2:19 pm ]
Post subject:  Sort Outlines Alphabetically

Is there any way to sort the Outlines object? I'm trying to take existing Outlines and order them by "title" alphabetically.

Something along the lines of:

Code:
doc.Outlines.OrderBy(p => p.title)
but modifying the existing PdfOutline

Alternatively if there is a certain way to remove all Outlines, and then I can sort them and re-insert.

I'm currently doing this
Code:
if (doc.Outlines.Count > 0)


but it occasionally fails on input with "Destination Array expected"

Thanks for any assistance!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/