Hi,
After further investigation, I found if Destination is null, the method bms[w].Destination.IsValid will throw the error "Object reference not set to an instance of an object". To avoid this, you could change the code in If condition.
- Code: Select all
if (bms[w].Destination == null || !bms[w].Destination.IsValid)
Besides, I noticed your code bms[4][2].Destination is null, please note it will throw error when using partBookmark.Action = new PdfGoToAction(partBookmarkDest) like your first issue. You need to add Destination when adding action.
As for merging issue, please provide your code and related files for further investigation.
Sincerely,
Betsy
E-iceblue support team