Correction. I'm using 2.1.0 Snapshot. Sorry if I caused any confusion

----- Original Message ----
From: Howard Shank <[EMAIL PROTECTED]>
To: Post all your questions about iText here 
<itext-questions@lists.sourceforge.net>
Sent: Thursday, January 31, 2008 8:24:47 AM
Subject: Re: [iText-questions] Hyperlinked Text : Snippet Appreciated!

Hi TIA,

I ran your sample code under 2.0.7 and it worked just fine.
This was the result from the HtmlWriter:

  <div>This is a continuous paragraph that 
  <a href="http://google.com";>has a link to
  </a> Google.
  </div>

Howard

----- Original Message ----
From: RM1X <[EMAIL PROTECTED]>
To: Post all your questions about iText here 
<itext-questions@lists.sourceforge.net>
Sent: Thursday, January 31, 2008 3:06:38 AM
Subject: Re: [iText-questions] Hyperlinked Text : Snippet Appreciated!

Hi Bruno,

  Thanks for your response.  First, I would never post here without
having looked around beforehand!  I ask for a snippet, because I am
running into a few difficulties.

I have a paragraph that in HTML, should look like this:

<p>This is a continuous paragraph that <a href="http://google.com";>has a
link to</a> Google.</p>

I rolled up my sleeves and tried the following:

****

Paragraph p = new Paragraph();
Anchor a = new Anchor( "has a link to" );
a.setReference( "http://google.com"; );

p.add( new Phrase( "This is a continuous paragraph that " ) );
p.add( a );
p.add( new Phrase( " Google." );

****

Unfortunately, this causes the Anchor to prefix a newline at its
insertion position, instead of continuing on the same line.  In
addition, all text after the anchor, is also hyperlinked, which is not
the desired effect.  In other words, the output looks like:

<p>This is a continuous paragraph that <br><a
href="http://google.com";>has a link to</a><a href="some horrible
local/file link"> Google.</a></p>

TIA





Bruno Lowagie wrote:
> RM1X wrote:
>  
>> Hi ITexters,
>>
>>  Is there an example snippet anywhere that describes the creation of 
>> hyperlinked text chunks?  I'd like to give some words/sentences in my 
>> document, hyperlink attributes such that when they are clicked, the user 
>> is ushered to a given page.
>>    
>
> I didn't have the time to reply yesterday, and as this is documented
> on many places, you probably found the answer yourself (unless you
> didn't do any effort). If not, there are some examples here:
> http://itextdocs.lowagie.com/tutorial/objects/anchors/
> br,
> Bruno
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>
>  



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to