Im trying to add a TOC to a PDF document with 15 pages. When I add any heading to the TOC I get ‘Index was outside the bounds of the array.’ wqhen the pdf is created. If I just add text the TOC adds ok, but as it isnt a heading I dont get the page numbers etc.
What I mean is:
tocPage.Paragraphs.Add(new Heading(1) { Text = “foo” });