On 6/4/2014 1:16 AM, minsu wrote: > I have a page dictionary and i want to know the page number of the page(eg. > 2nd page in this pdf). How can i do that. I tried to get a Simplebookmark of > the reader, but get null.
The concept of page numbers doesn't exist in PDF. The number of the page is *calculated* based on the occurrence of (the reference to) the page dictionary in the page tree. If you have a page dictionary, you need to know it's position in the page tree. You'll discover that a page dictionary has a Parent entry. This parent entry refers to a /Pages dictionary. This /Pages dictionary can either be the root of the page tree or a child of another /Pages dictionary. Read "The ABC of PDF with iText" for more info: https://leanpub.com/itext_pdfabc (this book is under construction). The page number that is visible to humans on the actual rendered page is just a couple of glyphs rendered at an arbitrary coordinate on a canvas. You can't easily extract the page number from the content stream of a page. ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php