0

i looked at all forum posts but i really can not find a working example or an idea i can start from that is working...

in my c# itextsharp project i try to get following things:

  1. TOC (Table of Content) which is linked to the content and has one or more pages and looks like this:

header1 ------ page7

header2 ------ page14

header3 ------ page17

  1. toc starting from the second page.

  2. every page (including the toc-page) should have a page number at the bottom (page x of xx).

that's all.

can someone provide a working example of this?

Herbatnik
  • 21
  • 4
  • 1
    Why are you asking something that is fully explained in the documentation? Did you overlook http://developers.itextpdf.com/content/itext-7-building-blocks or do you have troubles reading the Java code or are you still using an old iText version? Please read the documentation before posting a question. Never post a question without any code. Now you are just asking us to write your code in your place. We don't see any proof that you've done any effort. That is usually not accepted on Stack Overflow. – Bruno Lowagie Oct 13 '16 at 06:42
  • im using old version with c# 2.0 forms – Herbatnik Oct 13 '16 at 08:25
  • i looked at this documentation, there is no clear example of doing what i need. – Herbatnik Oct 13 '16 at 08:28
  • I don't know what C# 2.0 forms are, but why would you use the old version, if the new version has everything what you need, including the documentation on how to do it? There are two reasons why this question can be closed: (1.) it is too broad. You list your requirements and you demand "show me how it's done". That is not done on Stack Overflow. (2.) Every aspect you are asking for is explained in separate answers that are in the Q&A. I will close the question as a duplicate for one of these aspects. Start working on that part, then create separate questions for the other aspects. – Bruno Lowagie Oct 13 '16 at 09:25
  • So instead of making one question, saying I need 1, 2, and 3. Create a separate question for 1, a separate question for 2, and a separate question for 3. **Do not post a question without a code sample that shows what you have tried so far.** (And do not lie by saying "I looked at this documentation, there is no clear example of doing what I need" because you can easily be proven wrong) – Bruno Lowagie Oct 13 '16 at 09:26
  • Reordering pages is explained here [How to reorder the pages of a PDF file?](http://developers.itextpdf.com/question/how-reorder-pages-pdf-file). Creating a footer with page X of Y is explained here: [Adding page numbers to an existing PDF](http://developers.itextpdf.com/examples/columntext-examples-itext5/adding-page-numbers-existing-pdf). You can also add "Page X of Y" using page events, but since you want to reorder your pages after creating the TOC, the solution that uses `PdfStamper` is the better choice design-wise. – Bruno Lowagie Oct 13 '16 at 09:31
  • You could do everything in one go: create the TOC, add the footer, and reorder the pages, but if you are not using iText 7, the PDF you'll be creating will be suboptimal as you'll be creating a PDF with a linear page tree (and that's not elegant). In any case, the links prove that your allegation that the documentation isn't out there was wrong. – Bruno Lowagie Oct 13 '16 at 09:32

0 Answers0