Posted by a ceTe Software moderator
Hello,
Please make sure that you are adding the bookmark to the respective page to which you want to navigate and this will work for you. Below is the sample code for it.
FileInfo[] files = new DirectoryInfo(@"F:\temporary\PDFs").GetFiles("*.pdf");
int pagenumber;
foreach(FileInfo file in files)
{
PdfDocument pdf=new PdfDocument(file.FullName);
pagenumber= document.Pages.Count ;
Bookmark bookmark = new Bookmark(file.Name, 0, 0);
document.Append(pdf);
document.Pages[pagenumber].Elements.Add(bookmark);
pagenumber += pdf.Pages.Count;
}
document.Draw(@"C:\Mydocumet.pdf");
Thanks,
ceTe Software Support Team.