Merge external PDF files that have links in master PDF

Question:
We have a master PDF with Link annotations with the name of PDF files in specific folder.

Using PDFNet how can we:

  1. Load each of these linked to PDF files and append the pages to the end of the master PDF
  2. Replace the file name in the Link annotation with a link to the first page of the merged PDF
  3. Add the newly added/merged PDF also to the Outline of the PDF

Answer:
Great question, attached are both JAVA and C# code to accomplish this task.

PDFPageTest.java (2.5 KB)

PDFPageTest.cs (2.9 KB)