I would like to open a PDF document and add to it some bookmarks.
I have the titles for the bookmarks, and the page numbers associated with them (clicking
on a bookmark will go to a specified page in the document).
When going to a specified page, the current zoom level should not be change.
A VB.Net example will be great, but C# is welcome as well.
I use iTextSharp 5.3.
As a java resource i wouldn’t help you much in exact code that you want but generic algorithm will work for the same.
For single bookmark without kids(iText used terms kids i think you can find it in iTextSharp) is as follows
List>
Object–>List> and so on.I had used iText(2.1.4).
I have used sorted map of Page number as key(itrTtlPg.getKey()) and bookmark title as value(itrTtlPg.getValue()).
Title–>Is the bookmark title you want.
Action–>simply It is the action you want to take(as value “Go To” implies).
“Page”, pageNum + ” FitH ” + position;So it means when you click bookmark of specified string(Title) it will positioned the page specified by pageNum and Fit the whole area horizontally at position you mentioned(here rectangle object is page size,so top means it will fit horizontally at the top).FitV also there,to fit it vertically so that whole page can be displayed in window size.Another thing to mention as you mentioned to keep zoom level intact you must use FitH.
If the above text helps you you can write VB/C# code as you wish.Also set setViewerPreferences(PdfWriter.PageModeUseOutlines) if you want to see bookmark as outline.