Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Table of Contents in Merged pdf (Aspose Pdf 8.5)

$
0
0

Hi,
I have a requirement in my project to create Table of Contents in Merged pdf in .NET. We are already using Aspose old version of Word and Pdf and now evaluating Aspose pdf 8.5.

I have attached some sample Pdfs "TestAlert1" , "TestAlert2" , "TestAlert3" and  "TestAlert4" that needs to be merged (copy pages from one PDF file to another PDF in the end) . These pages needs to be added just after end of content of pdf 1 . Then add Table of contents with Heading as the Text in Red (refer to text mentioned at top (in Red background in each individual pdf ). Please refer to resultant sample pdf as required "Pdf_RequiredTemplate" .

I tried to use the code as mentioned in attached file "CreateToC.txt" , but it is giving Error "Error_CreatingToC.png". Also , this will not merge pdfs as required (start new pdf after end of content of first pdf).

This is very urgent . Appreciate your quick response.

 

[EDIT]

I spent time to create TOC based on the details available on your site (please refer attached code file "Code_ForToCCreation")

Problems :

1) I am not able to get the TOC as required (refer Pdf_RequiredTemplate). I am able to concatenate the pdfs , but we need to append pdf just after finish of first pdf , not with new page.

2) I have created Pdf thru function "ProcessAlerts" and if there are more than one Alert/Id selected , we need to concatenate pdfs . I am using function "AppendPdfs" and passing pdfs but it is giving Error (not takeing ref of pdf). Please suggest what is wrong with this code. For testing purpose I have give the path and commented

 Aspose.Pdf.Document pdfDocument1 = new Aspose.Pdf.Document("D:/pdftest/TestAlertDoc0.pdf");
            //Aspose.Pdf.Document pdfDocument1 = new Aspose.Pdf.Document(dstPdf);
            //open second document
            Aspose.Pdf.Document pdfDocument2 = new Aspose.Pdf.Document("D:/pdftest/TestAlertDoc1.pdf");
            //Aspose.Pdf.Document pdfDocument2 = new Aspose.Pdf.Document(srcPdf);

 

3) I have used two different functions to create ToC in different ways:

"CreateTOCConcatenatedPdfUpdated" - use FileStream object.

Pdf created is "Concatenated_Table_Of_Contents.pdf". Here we need to show ToC with Page number like in Word. I can see link but its not visible and also link hand is visible only in certain area. Please suggest how to set the height/width in link object here , so that Heading Text can expand in multiple lines and show Page number like Heading 1 ............ 2 etc

Secind method used is "CreateToCAlertNew" , it takes concatenated file created by AppendPdfs function and then create ToC. File generated using this function is "TOC_Output". I need to understand how to set the headling link to goto the correct Heading. and how to set spacing , font size etc between different lines in ToC.

Request your guidance .

Thanks ,
Preeti


Viewing all articles
Browse latest Browse all 3131

Trending Articles