Hi All,

  Paulo, thanks for your reply. But as I was going through the "iText in
Action" with regard to you reply, I found another way to add annotations --
using the Chunk.setAction() method. But it doesnt seem to work though.
Here's the program I have done. It creates the pdf but without the link. I
want a link so that one goes to the 2nd page when he clicks the chunk on the
1st page. Can anybody tell me whats wrong with this prog. ??


//My Prog for PDF annotations
import com.lowagie.text.pdf.*;
import com.lowagie.text.*;

import java.io.*;


class  PdfAnn
{
        public static void main(String[] args) 

        {
                Document doc = new Document();
                try
                {
                        PdfWriter writer = PdfWriter.getInstance (doc, new
FileOutputStream("C:\\PdfAnn.pdf"));

                        doc.open();
                        

                        PdfAction act = new PdfAction();

                        act.gotoLocalPage(2,new 
PdfDestination(PdfDestination.FITB), writer);

                        Chunk chk = new Chunk("Quick Brown Fox Jumps over the 
lazy dog");
                        chk.setAction(act);

                        Paragraph para = new Paragraph(chk);
                        
                        chk.setNewPage();
                        doc.add(para);

                        doc.add (new Paragraph ("This should where it is to be 
linked to ..."));

                        doc.close();
                        

                }
                catch ( Exception e)
                {
                        e.printStackTrace();
                }

        }
}


Thanks,
Midhun
-- 
View this message in context: 
http://www.nabble.com/Annotations-using-chunks-tf3656287.html#a10214951
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to