Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
pls help

How can I am working on a pdf project i want to find all internal links in pdf file i finding all external links but i am not able to find internal links.

code for external links. I am using ItextSharp dll.

C#
PdfArray Annots = PageDictionary.GetAsArray(PdfName.ANNOTS);
 foreach (PdfObject A in Annots.ArrayList)
                    {
                        //Convert the itext-specific object as a generic PDF object
                        PdfDictionary AnnotationDictionary = (PdfDictionary)PdfReader.GetPdfObject(A);


                        //Make sure this annotation has a link



                        if (!AnnotationDictionary.Get(PdfName.SUBTYPE).Equals(PdfName.LINK))
                            continue;

                        //Make sure this annotation has an ACTION
                        if (AnnotationDictionary.Get(PdfName.A) == null)
                            continue;

                        //Get the ACTION for the current annotation
                        PdfDictionary AnnotationAction = AnnotationDictionary.GetAsDict(PdfName.A);
                        //  PdfDictionary AnnotationAction = (PdfDictionary)AnnotationDictionary.Get(PdfName.A);
                       
                        
                        if (AnnotationAction.Get(PdfName.S).Equals(PdfName.URI))
                        {
Posted
Updated 13-Feb-14 20:44pm
v8

1 solution

try checking out this site Extract Text from PDF in C# (100% .NET)[^] or you could also check out Converting PDF to Text in C#[^]
 
Share this answer
 
Comments
Ashwani Gusain 13-Feb-14 5:48am    
Hi Charles its not help ful i want internal links in pdf

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900