I am afraid Aspose.Pdf.Kit for Java does not support the feature to manipulate/create TOC in existing PDF files. For the sake of implementation, I have logged this requirement as PDFKITJAVA-33274 in our issue tracking system. Furthermore, we already have logged a requirement to update page numbers information in TOC as PDFKITJAVA-15375.branislav.cavlin:recreate TOC on merged documents (found basic example that does not produce nice looking TOC - for example when I create TOC with Words library and convert it to PDF, it looks much much nicer),
If you need to update the page number information in Header/Footer, you may try updating/replacing the text. For more information, Manipulate Text Inside a Rectanglebranislav.cavlin:renumber pages (not found),
This requirement is logged as PDFKITJAVA-33275.branislav.cavlin:change margins (not found for Pdf.Kit).
Please visit the following links for information onbranislav.cavlin:I would probably needs other things to change existing text on some elements for example.
branislav.cavlin:Any help is appreciated if you can suggest how to do this. I would normally use Words for this as it is much easier to work with DOC, but I need to merge different documents like (other DOC, DOCX, Excel, Images, other PDF files) and the easiest way to do this (I think) with your library is to convert everything to PDF and the merge and reshape content.
Thank you for the quick reply.
Thanks for the reply,
branislav.cavlin:but it seems that I had to remove footer from Word converted document as it ended up in the body of PDF (or this is what it seemed to me).
branislav.cavlin:Also, it seems that when using both addPageNumber and addFooter, they overwrite each other.
String inFile = "example2.pdf";
String outFile = "kitOut.pdf";
PdfFileStamp fileStamp = new PdfFileStamp(inFile, outFile);
FormattedText logo1 = new FormattedText("Hello World!", new FontColor(0, 20, 180),
FontStyle.TimesRoman, EncodingType.Winansi, false, 12);
FormattedText logo2 = new FormattedText("Aspose.Pdf.Kit", new Color(10, 30, 100), FontStyle.HelveticaOblique,
EncodingType.Winansi, false, 20);
fileStamp.addLogomark(logo1, 20, 50);
fileStamp.addLogomark(logo2, 20, 70);
fileStamp.addWatermark("imgLogoPDFKit.gif", 100, 100);
Aspose.Pdf.Kit for Java does not support the Mail Merge feature but you may use Aspose.Pdf.Kit in conjunction with Aspose.Words to fulfill your requirements. In case we can be of any further assistance, please feel free to contact. We are sorry for your inconvenience.branislav.cavlin:Aspose PDF will not do for us, as we need to use mail merge for Words. Also, we are aiming to manipulate already existing PDF documents. So we need to change margins, page numbers, update headers and footers, remove TOC from other documents and regenerate one TOC in the beginning of the merged document. It seems like a LOT of work using Pdf.Kit nad the Pdf products to recreate TOC. Also, I have to keep in mind that some information about headers is lost when we convert to PDF (I believe).