Hi i have attached the code for your reference,

PdfReader inputPdf = new PdfReader(file);
            
            //inputPdf.GetLinks(inputPdf.NumberOfPages-1);
            // retrieve the total number of pages
            int pageCount = inputPdf.NumberOfPages;
            
            List<PdfAnnotation.PdfImportedLink> attonsample = 
inputPdf.GetLinks(pageCount);
      
            int end = pageCount - 1;
            int start = 1;
           

            if (end < start || end > pageCount)
            {
                end = pageCount;
            }

            // load the input document
            Document inputDoc =
                new Document(inputPdf.GetPageSizeWithRotation(1));

            // create the filestream
            using (FileStream fs = new FileStream(outputFile, FileMode.Create))
            {
                // create the output writer
                PdfWriter outputWriter = PdfWriter.GetInstance(inputDoc, fs);
               
                inputDoc.Open();
                PdfContentByte cb1 = outputWriter.DirectContent;
                
                //PdfAction act = new PdfAction("http://sample.com";, 1);
                
                // copy pages from input to output document
                for (int i = start; i <= end; i++)
                {
                    
                    inputDoc.SetPageSize(inputPdf.GetPageSizeWithRotation(i));
                    inputDoc.NewPage();


                    PdfImportedPage page =
                        outputWriter.GetImportedPage(inputPdf, i);
                    int rotation = inputPdf.GetPageRotation(i);

                    if (rotation == 90 || rotation == 270)
                    {
                        cb1.AddTemplate(page, 0, -1f, 1f, 0, 0,
                            inputPdf.GetPageSizeWithRotation(i).Height);
                    }
                    else
                    {
                        cb1.AddTemplate(page, 1f, 0, 0, 1f, 0, 0);

                    }

                }

                inputDoc.Close();
            }


Can you suggest me where there is flaw in the code or suggest some other way to 
split the pdf such that it I can read hyperlink,,........

--- On Thu, 12/8/10, 1T3XT info <[email protected]> wrote:

From: 1T3XT info <[email protected]>
Subject: Re: [iText-questions] How to read Hyperlink VB.NET
To: "Post all your questions about iText here" 
<[email protected]>
Date: Thursday, 12 August, 2010, 7:55 AM

KARTHIKEYAN wrote:
> Hi ,
> How to read hyperlink in pdfreader class using itextsharp in ASP.NET. 
> issue I am facing is,I am having a pdf with hyperlink,but when I split the 
> pdf using itextsharp I didn't get that hyperlink.

There are at least three different ways to split a PDF,
and two of those solutions preserve hyperlinks.
Maybe you're using a solution that doesn't.
How are you splitting the PDF?
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
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/


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
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/

Reply via email to