We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Merging to files with same name Named Destination


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 =
, @“TestData\Merge\Names\Example2.pdf”
PdfFileEditor editor =
new PdfFileEditor
CloseConcatenatedStreams = true,
AllowConcatenateExceptions = true
editor.Concatenate(files, “merged_names.pdf”);

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?

Jacek Bator

Hi Jacek,

Thanks for your inquiry. We have noticed the reported issue in Aspose.Pdf for .NET 9.2.1 and logged it as investigation ticket as PDFNEWNET-37030 for further investigation and resolution. We will keep you updated about the issue resolution progress via this thread.

We are sorry for the inconvenience caused.

Best Regards,