The intent here is to validate pdf doc for more readability like validating
table structure in pdf contents. I am determining a page number for pdf
contents. I parse pdf contents as a tree node like table,list, and link
etc...For example, I get indirect reference for node (table) using this
statement PdfIndirectReference pageRef =
getITxtDictionary().getAsIndirectObject(PdfName.PG); and use the following
for loop like simplebookmark example to get page number. Please let me know,
if this works for me.
public int getPageNumber(PdfIndirectReference pageRef) {
if (pageRef == null) return -1;
for (int i=0; i<reader.getNumberOfPages(); ++i) {
if (reader.getPageOrigRef(i+1).getNumber() ==
pageRef.getNumber())
return i+1;
}
return -1;
}
1T3XT info wrote:
>
> newoutlook wrote:
>> I am using the following code to get page number for a node.
>
> Can you explain what you're doing and why?
> --
> This answer is provided by 1T3XT BVBA
> http://www.1t3xt.com/ - http://www.1t3xt.info
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for
> Conference
> attendees to learn about information security's most important issues
> through
> interactions with peers, luminaries and emerging and established
> companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
>
>
--
View this message in context:
http://old.nabble.com/page-number-determination-tp27218494p27228781.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/