Merge Pdf's with their own bookmarks included

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Merger for .NET (v4)  /  Merge Pdf's with their own bookmarks included

DynamicPDF Merger for .NET (v4) Forum

Hi,

I am writing a program that merges PDF's together. When they are merged I need to also add the bookmarks it has. Currently the bookmarks are being added at the root level of bookmarks when they should be nested into the PDF that they belong to not in the root level. Can anyone help me and/or provide some simple example code in VB.NET?
Posted by a ceTe Software moderator
Hello,

If you perform simple merging then the DynamicPDF API by default adds the bookmarks of the merged document at root level. Currently it is not possible to add the bookmarks of the merged PDF as child bookmarks using version 4 DynamicPDF Merger API.

The latest v8 DynamicPDF Merger for .NET allows you to retrieve the list of bookmarks and bookmark information (target page number and bookmark text) from an existing PDF. You will need to use the PdfDocument class members to do this. Please refer to the documentation on reading bookmark/outline information from an existing PDF here.

If you would like to rearrange the bookmarks in the merge output PDF then you will need to remove the existing bookmarks from the merged output. Add new bookmarks to the merged PDF using the retrieved bookmark information. You can refer to the documentation on bookmarks here.

If you would like to evaluate the latest DynamicPDF product then you can download it from our website  here.

Thanks,
ceTe Software Support Team.
Thanks for the response.

Just so that I understand clearly and this may be helpful to you also - I am looping through a set of PDF's that are appended one after another to make one large, merged PDF and some have Bookmarks and some do not. So, to get the bookmarks to stay in place with each PDF, whether they are nested bookmarks or at the root level, I have to know the outline information such as text and page number of each bookmark?

I am trying to understand the logic because I've been struggling for a while now. I really appreciate your help!

Thank you.
Posted by a ceTe Software moderator
Hello,

Can you please send over the following details to support@cete.com so we can look into it further?

1.Sample input PDFs.
2.Output PDF.
3.Code sample used.
4.Exact version and build number of the DynamicPDF DLL file. You can get this information in DLL references properties (Version and Description fields) in Visual Studio.
5.More details about your requirements by referring to the input PDFs and output PDF.

Thanks,
ceTe Software Support Team
Posted by a ceTe Software moderator
Hello,

Thanks for sending all the information. In order to add the bookmarks as child bookmarks you will need to set the correct parent outline. Also you will need to check for the child outlines recursively for each outline and add them to the parent outline. If anyone else needs sample code for this please email support@cete.com.

Thanks,
ceTe Software Support Team.
Thanks for your help. Your example code worked well with what I had to accomplish.

All times are US Eastern Standard time. The time now is 6:35 AM.