Hi,
I try to split one PDF document into several pieces using the following piece of code
Code: C#
PdfDocument doc = new PdfDocument(@"d:\Test.pdf");
foreach (PdfBookmark bm in doc.Bookmarks)
{
PdfDocument doc2 = doc.Clone(bm.Destination.Page.Index, 1);
}
The first two pages are cloned succesfull, but on page index 2 i get a ArgumentNullException with the message "Value cannot be null. Parameter name: key"
The same exception occurs when I try to use the Split function.
I will send the PDF file that will trigger the exception to support email right after posting this message.
Here is the stack trace:
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
at EO.Pdf.Internal.ai.c(a A_0)
at EO.Pdf.PdfDocument.<>c__DisplayClass2.<Clone>b__0(ld obj)
at EO.Pdf.Internal.ag.b(ld A_0)
at EO.Pdf.Internal.w.a(ag A_0)
at EO.Pdf.Internal.ag.b(ld A_0)
at EO.Pdf.Internal.ea.a(ag A_0)
at EO.Pdf.Internal.ag.b(ld A_0)
at EO.Pdf.Internal.w.a(ag A_0)
at EO.Pdf.Internal.ag.b(ld A_0)
at EO.Pdf.Internal.ah.a(ag A_0)
at EO.Pdf.Internal.ag.b(ld A_0)
at EO.Pdf.Internal.ea.a(ag A_0)
at EO.Pdf.Internal.ag.b(ld A_0)
at EO.Pdf.Internal.ah.a(ag A_0)
at EO.Pdf.Internal.ag.b(ld A_0)
at EO.Pdf.Internal.ea.a(ag A_0)
at EO.Pdf.Internal.ag.b(ld A_0)
at EO.Pdf.Internal.ah.a(ag A_0)
at EO.Pdf.Internal.ag.b(ld A_0)
at EO.Pdf.Internal.ag.a(IEnumerable`1 A_0)
at EO.Pdf.Internal.ag.a(hi A_0)
at EO.Pdf.PdfDocument.Clone(Int32 fromPage, Int32 pageCount)
... my code
Thanks a lot for looking into the problem.
Jochen