Adding new heading for new merged pdf

Hi,


Can you show me how can i add the heading to the newly merged pdfs files in order the newly merged pdfs can link to the table of contents?

Thank you,

Choong

Hi Choong,

Thank you very much for considering Aspose.

I’m afraid, I couldn’t understand your requirement clearly. Can you please elaborate it a little bit with the help of some sample PDF files?

We’re sorry for the inconvenience and looking forward to help you out.
Regards,

What i mean is,


I have a few pdfs, in my final result, i need to merge all the pdfs become one file and i need to have table of contents which able to link to the merged content. example as below:

input:
1) 001.pdf
2) 002.pdf
3) 003.pdf


output:
1) Merged.pdf

Table Of Contents

001.pdf …2
002.pdf …5
003.pdf…8


when i click to the 002.pdf, it should able to link to the page i append/merge on merged.pdf

I am using PdfFileEditor to merge all the files, but i am no idea how can i add the link to the table of contents.

Choong

Hi Choong,

In order to fulfill your requirement, you can use CreateLocalLink method of PdfContentEditor class. This method allows you to specify a clickable area and the target page to move to when this particular area is clicked. You can mark the area around some text to create a local link (or multiple links for that matter).

Please try it at your end and if it doesn’t resolve your issue then please do let us know.
Regards,

Hi,

our situation is we have few documents want to merge into a file,and each document's first page will be add into bookmarks as chapter.


Therefore the table of contents will be like below..


1. Chapter 1
1.1 MyDoc.pdf ------------------------- 5
1.2 MyDoc2.pdf ------------------------- 10

2. Chapter 2
2.1 abc.pdf ---------------------------- 12
2.2 abc2.pdf -----------------------------22


Besides that, how to add page number after file merged.

Please advice.

Regards
Lim




Hi Lim,

I would like to share that creating bookmarks and the ‘table of contents’ are two different things. If you’re trying to create the table of contents i.e. a list of the links on the first page, to navigate to the other pages then I’m afraid, Aspose.Pdf.Kit can’t understand for which page you want to create the links.

So, in order to achieve this functionality, you can keep track of the merged PDF files and then use the code sample shared above to create the links.

If I haven’t understood your requirement clearly or you have some other questions, please do let us know.
Regards,

Hi,


About the table of Contents, i create the TOC by using “ListType.TableOfContents” method.

How to update the page number in TOC , say example,


Table of Contents

1. Chapter 1…1
2. Chapter 2…2
3. Chapter 3…3


i want it to become below format


Table of Contents

1. Chapter 1…1
2. Chapter 2…5
3. Chapter 3…11


thank you


Hi Lim,

I’m sorry to inform you that this feature is currently not supported in Aspose.Pdf.Kit, however I have logged a new feature request as PDFKITNET-15376 in our issue tracking system. Our team will look into this requirement and we’ll try to provide this functionality in our future versions.

We’re sorry for the inconvenience.
Regards,