I use the page map to get the object ID and generation from bookmarks.
Here's how (I omitted the iteration over the entire document catalog to
keep it simple):
PDDocumentOutline root = doc.getDocumentCatalog().getDocumentOutline();
PDOutlineItem item = root.getFirstChild();
COSObject targetPageRef =
(COSObject)((COSArray)item.getAction().getCOSDictionary().getDictionaryObject("D")).get(0);
I did a lot of reading of the PDF spec and debugging to figure that one
out. For pages, I'd suggest looking at the parser to see where its read
in and stored; you should be able to figure out how to get it from there.
Hope this helps.
--Adam
From:
Wulf Berschin <[email protected]>
To:
[email protected]
Date:
11/09/2009 09:04
Subject:
How to get Page Number from a PDPage
Hi,
how do I get the page number of a PDPageXYDestination which returns a
PDPage?
I saw that PDDocument holds a pageMap which maps object/generationnumber
to page numbers but, unfortunately I don't see a way how to get this
object/generationnumber of a PDPage, but porbably I am off the track...
Thanks, Wulf
? Click here to submit conditions
This email and any content within or attached hereto from Sun West Mortgage
Company, Inc. is confidential and/or legally privileged. The information is
intended only for the use of the individual or entity named on this email. If
you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution or the taking of any action in reliance on
the contents of this email information is strictly prohibited, and that the
documents should be returned to this office immediately by email. Receipt by
anyone other than the intended recipient is not a waiver of any privilege.
Please do not include your social security number, account number, or any other
personal or financial information in the content of the email. Should you have
any questions, please call (800) 453 7884.