Book mark on merged pdf

Book mark on merged pdf

Forum member · Apr 2, 2012
Can someone please help me on how we can place a book mark on a merged output pdf via C#. I'd appended the file using pdfDocuments.ForEach(documentPdf => document.Append(documentPdf)); Now i need to add bookmark Requesting your help Thanks Santo

Re: Book mark on merged pdf

Forum member · Apr 2, 2012
Thanks for the prompt and helpful reply. Could you please help me on how we could give excel sheetnames as bookmarks

Re: Book mark on merged pdf

Support · Apr 2, 2012
Hello, Our API does not read the excel sheets so you would need to use some other API to read the excel sheet names. Once you have the names of the excel sheets, you could use them to create bookmarks. Just specify the name of the sheet in the bookmark constructor , both the constructors takes a string parameter. Thanks, ceTe Software Support Team.

Re: Book mark on merged pdf

Forum member · Apr 3, 2012
Still I was succesful in creating bookmarks but it doesn't work as intended means when clicking on the link it doesn't leads to the corresponding page in the merged document.

Re: Book mark on merged pdf

Support · Apr 3, 2012
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.