Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Deleting multiple particular bookmarks causes NullReferenceException

$
0
0
Hello, 

I am trying to delete several specific bookmarks. The first deletion works very well but the second deletion results in a nullreference exception.

I am using version: 10.2.0

Edit: 
Here is my code:

Document pdfDocument = null;
var pdflicense = new License();
pdflicense.SetLicense(@"C:\temp\Aspose.Pdf.lic");
pdflicense.Embedded = true;

pdfDocument = new Document(@"C:\temp\input.pdf");
pdfDocument.Outlines.Delete("Child1");
pdfDocument.Outlines.Delete("Child2");
pdfDocument.Outlines.Delete("Child3");
pdfDocument.Outlines.Delete("Child4");
pdfDocument.Outlines.Delete("Child5");
pdfDocument.Outlines.Delete("Child6");
pdfDocument.Save(@"C:\temp\output.pdf");

I have also attached two screenshots: 
- The bookmark structure in the pdf file
- A screenshot from the exception in Visual Studio

Thank you for your help!

Viewing all articles
Browse latest Browse all 3131

Trending Articles