SimpleBookmark will get the outlines for you in a legible way and even 
present the page numbers as a bonus.

Paulo

----- Original Message ----- 
From: "Edward W. Rouse" <[EMAIL PROTECTED]>
To: "'Post all your questions about iText here'" 
<itext-questions@lists.sourceforge.net>
Sent: Wednesday, February 13, 2008 9:38 PM
Subject: Re: [iText-questions] get a page number from a PdfDictionary


> Let me try again. I saw an example that used PdfCopy. Seemed simple 
> enough. You use the getImportedPage(PdfReader, int) method to
> get the page from the reader and then use the addPage(PdfImportedPage) to 
> put it in the new one. Very clean and simple. The problem
> is getting the page numbers as ints for getImportedPage. The example was 
> very simple in that they only dealt with 1 level of
> bookmarks, so they could just grab the count and go from there. My problem 
> is more complex in that I have multiple levels of
> bookmarks and I may have to skip around a bit.
>
> I have found how to get the page dictionaries, which include the indirect 
> references. I just haven't been able to figure out how to
> use that information to get the page number required by the 
> getImportedPage method of PdfCopy. If it is not possible to do this,
> then I will look for another solution.
>
> Thanks.
>
> Edward W. Rouse
> ComSquared Systems, Inc.
>
>
>
>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] On
>> Behalf Of Bruno Lowagie
>> Sent: Wednesday, February 13, 2008 2:00 PM
>> To: Post all your questions about iText here
>> Subject: Re: [iText-questions] get a page number from a PdfDictionary
>>
>>
>> Edward W. Rouse wrote:
>> > I have been searching the mailing list archives and using
>> Google for
>> > hours and haven't found the answer, so I am asking here.
>>
>> Have you read the PDF Reference?
>> There's no such thing as page numbers in the page(s) dictionary.
>> There's the page tree from which you can retrieve the order
>> of the pages, and as soon as you know the order, you know
>> the page number. Therefore there's no need to store the page
>> number in any page or pages dictionary. Maybe you are confusing
>> with page labels; if so, please consult the API for PdfPageLabels.
>> http://itext.ugent.be/library/api/com/lowagie/text/pdf/PdfPage
> Labels.html#getPageLabels(com.lowagie.text.pdf.PdfReader)
>
> br,
> Bruno


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to