You should probably do some background reading either in the PDF Reference/ISO
32000-1 or the iText book about Actions, especially URI actions. URI actions
are the thing in the PDF language that would "invoke" the equivalent of HTML's
href element.
Actions can be associated with various things, but if it something visible on
the page that you click on, then it will most certainly be connected to an
Annot. So if there are no Annots on the page, then there are no "hyperlinks"
on that page.
HOWEVER, that doesn't mean that when viewed in some viewers, that there aren't
"hot spots" as some viewers (eg. Adobe Acrobat/Reader) will auto-detect what
appear to be URLs in text and make them "hot" even w/o the presense of URI
actions.
Leonard
From: Gurla Prasad [mailto:[email protected]]
Sent: Thursday, April 08, 2010 10:27 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] extract anchors
Leonard,
Thanks for your answer. Please excuse me as I am a starter. Actually my aim is
to find all hyperlinks in a pdf.
Right now in one part of my code I use.
PdfReader reader = new PdfReader(new RandomAccessFileOrArray(filename), null);
PdfDictionary pagedic = reader.GetPageN(1); // 1st page of pdf HAS a hyperlink
PdfArray annotarray =
(PdfArray)PdfReader.GetPdfObject(pagedic.Get(PdfName.ANNOTS));
When I look into annotarray, it is null. The 1st page of the pdf DOES have a
hyperlink.
Can hyperlinks exist in a pdf in other forms apart from annotations?
That is the reason I was thinking maybe there is an anchor object?
Thank you,
Prasad.
On Thu, Apr 8, 2010 at 4:09 PM, Leonard Rosenthol
<[email protected]<mailto:[email protected]>> wrote:
So if you can find all of the Link annotations, what else do you want to find?
Did you find their Actions? Did you look to see what they were?
Are you going to concern yourself with all the other places in a PDF that an
Action can live?
Leonard
From: Gurla Prasad
[mailto:[email protected]<mailto:[email protected]>]
Sent: Thursday, April 08, 2010 10:04 AM
To: Post all your questions about iText here
Subject: [iText-questions] extract anchors
Dear All,
Is it possible to extract anchors (external links) from a pdf?
I have successfully extracted annotations of subtype "Link".
Can someone lead me in the right direction?
Thanks in advance,
Prasad.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.itextpdf.com/book/
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/
--
kalpanaprasad
Serskamp
Belgium
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.itextpdf.com/book/
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/