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
Book mark on merged pdf
Re: Book mark on merged pdf
Support · Apr 2, 2012Hello Santo,
You can add bookmarks to the PDF document without any problem using our DynamicPDF Merger for .NET product. You will need to use the Bookmark page element to do this. You can also use the Outlines class to achieve your requirements. Please refer documentation on bookmarks and outlines at: http://www.DynamicPDF.com/Support/NET_Help_Library_07_03/Outlines%20and%20BookMarks.html
.
Thanks,
ceTe Software Support Team.
Re: Book mark on merged pdf
Forum member · Apr 2, 2012Thanks 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, 2012Hello,
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, 2012Still 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, 2012Hello,
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.