Posted by a ceTe Software moderator
Hello Maren,
Since you don’t need the existing bookmarks in documents 3 and 4 I suggest you avoid importing them as shown below using MergeOptions class. This should resolve the issue you are experiencing.
Dim mdoc As Merger.MergeDocument = New Merger.MergeDocument()
Dim pageList As New List(Of Integer)
Dim options As MergeOptions = New MergeOptions()
options.Outlines = False
mdoc.Append("D:\Index.pdf")
pageList.Add(mdoc.Pages.Count)
mdoc.Append("D:\1.pdf")
mdoc.Append("D:\2.pdf")
pageList.Add(mdoc.Pages.Count)
mdoc.Append("D:\3.pdf", options)
pageList.Add(mdoc.Pages.Count)
mdoc.Append("D:\4.pdf", options)
For i As Integer = 0 To pageList.Count - 1
mdoc.Pages(pageList(i)).Elements.Add(New Bookmark("Page " & pageList(i), 0, 0))
Next
mdoc.Draw("D:\output.pdf")
Thanks,
ceTe Software Support Team.