Have situation when I merging many files which contains link annotations pointing to named destinations. Unfortunately some destination names overlap beetween files. Aspose.Pdf merges them without any consideration and because of this Names dictionary in merged file contains many destinations with same name but pointing to various page objects.
Attached example: Example.pdf and Example2.pdf. Identical files each of them has annotation link on first page pointing to named annotation with name “Page 2”. After merging Names dictionary looks like follows:
28 0 obj
<</Names 29 0 R>>
29 0 obj
[(Page 2)30 0 R(Page 2)53 0 R]
and both links point to same page no 2 (I guess acrobat picks first entry) while second link should point to page no 4.
There are two solutions for this:
1) Aspose.Pdf should prefix named destinations names and named destination link names with some prefix (ex. file name) So first could be named “Example+Page 2” and second "Example2+Page 2"
2) Aspose.Pdf should replace all annotation links (or outlines) pointing to named destinations with normal GoTo action links for proper pages.
Of course I can do both manually before merge but it takes precious processing time.
Are there any other options for this?
My merge code is:
public void merges_named_destinations_whit_same_names()
string files =
PdfFileEditor editor =
CloseConcatenatedStreams = true,
AllowConcatenateExceptions = true
Tested with Aspose.Pdf 8.8 and 9.2.1
It seems that I can alter link annotations itself but I cannot manage Named Destination list in document (one edited by View/Navigation Tabs/Destinations in Acrobat Professional 7). So I cannot implement 1) workaround by myself.
Is there any way to edit/alter this list?