Q: Links are not working while Merge PDF using itextsharp My task is to merge multiple pdf to single pdf and I can achieve the merger pdf but I am facing issue in the internal links (named destination) are missed up from second pdf where as its working in first pdf. My issues are similiar to the below post.
Pdf Merge Issue in ItextSharp (After Merging Pdfs don't retain their Values)
But I did not achieve this.
My code are below.
class Program
    {
        static void Main(string[] args)
        {
            Document document = new Document();

            string[] fileNames = @"D:\PDF_Protect\ToMerge\Test\pdf1.pdf;D:\PDF_Protect\ToMerge\Test\pdf2.pdf;D:\PDF_Protect\ToMerge\Test\pdf3.pdf;".Split(';');
            string outFile = @"D:\PDF_Protect\ToMerge\output\merged.pdf";

           //merge one
            PdfCopy pdf = new PdfCopy(document, new FileStream(outFile, FileMode.Create));
            document.Open();
            foreach (string fileName in fileNames)
            {
                PdfReader reader = new PdfReader(fileName);
                reader.ConsolidateNamedDestinations();
                var pdfDestination = new PdfDestination(PdfDestination.FIT);
                //var pdfAction = PdfAction.GotoLocalPage(1, pdfDestination, pdf);
                //pdf.SetOpenAction(pdfAction);
                pdf.AddDocument(reader);
                reader.Close();
            }
            document.Close();
        }
    }

Kindly guide me how to regenerate the links working throughout the merged pdf.
