FW: FW: FW: Invisible links

View: New views
2 Messages — Rating Filter:   Alert me  

FW: FW: FW: Invisible links

by John Renfrew :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Because it is being stamped...??



john renfrew
Right Way Up
Office  +44 1675 475341
Fax      +44 1675 475342
Mobile +44 7767 443992


-----Original Message-----
From: 1T3XT info [mailto:info@...]
Sent: 06 November 2009 15:22
To: Post all your questions about iText here
Subject: Re: [iText-questions] FW: FW: Invisible links

John Renfrew wrote:
> Because it does not make it 'invisible' when run on a PC.....

Works for me (both on Windows Vista and Windows XP).

Moreover: if you use the Anchor object, iText creates such a link
internally. So... if you don't succeed in making such a link the hard
way, why don't you create one the easy way: create a Chunk, use
setAnchor(), wrap it in a Phrase and add it to the document with ColumnText.
Or: get the iText source code and find out how Anchor objects, or Chunks
with an anchor attribute, are added by iText internally.

I don't understand why the question is recurring over and over on the list.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

----------------------------------------------------------------------------
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@...
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/


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@...
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/

Re: FW: FW: FW: Invisible links

by 1T3XT info :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

John Renfrew wrote:
> Because it is being stamped...??

*SIGH*

See the example and the attached PDF.
Isn't that what you need?
If so, please tell me what is wrong with the documentation.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfAction;
import com.lowagie.text.pdf.PdfAnnotation;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfStamper;
import com.lowagie.text.pdf.PdfWriter;


public class AddLink {

        public static void main(String[] args) throws DocumentException, IOException {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                Document document = new Document();
                PdfWriter.getInstance(document, baos);
                document.open();
                document.add(new Paragraph("Hello World!"));
                document.close();
               
                PdfReader reader = new PdfReader(baos.toByteArray());
                PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("test.pdf"));
                PdfWriter writer = stamper.getWriter();
                PdfAnnotation link = new PdfAnnotation(writer, 36 ,36, 559, 806,
                                  new PdfAction("mailto:john@...?subject=stuff"));
                stamper.addAnnotation(link, 1);
                stamper.close();
        }
}


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@...
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/

test.pdf (1K) Download Attachment