setRenderingHint...worked for me..But this creates a link which in turn opens
the link in the same browser window. 

I tried using the following in setRenderingHint:
JavaScript:mv=window.open('http://,,,','window1');mv.focus(); but that did
not work.

Any idea how can I specify to open link in new window?

Thanks,
-Saurabh

Paulo Soares-3 wrote:
> 
> I've never used it but as far as I'm aware:
> 
> g2.setRenderingHint(PdfGraphics2D.HyperLinkKey.KEY_INSTANCE,
> "http://go.to";);
> // Write your text here
> g2.setRenderingHint(PdfGraphics2D.HyperLinkKey.KEY_INSTANCE,
> PdfGraphics2D.HyperLinkKey.VALUE_HYPERLINKKEY_OFF);
> 
> Paulo
> 
>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] On
>> Behalf Of aerogun2
>> Sent: Tuesday, August 19, 2008 7:06 PM
>> To: itext-questions@lists.sourceforge.net
>> Subject: Re: [iText-questions] Create text URL's within
>> document created using Graphics2D
>>
>>
>> Paulo,
>>
>> Thanks for the reply..Not sure how I can pass
>> HyperLinkKey.KEY_INSTANCE as
>> its
>> not accessible. I dont see any documentation on that too.
>>
>> Also,I looked at setRenderingHint(Key,Object) and dont see
>> what value to
>> pass
>> for Key. Is that the value of text element in the table?
>>
>> Maybe an example would help..
>>
>> Thanks again,
>> -SaurabhPaulo
>>
>> aerogun2 wrote:
>> >
>> > Hi,
>> >
>> > I have created a pdf document using the Graphics2D that
>> displays element
>> > in a
>> > table. Now, for the elements within table, I want to make
>> them hyperlinks
>> > that
>> > will launch HTML pages. Problem is I cannot figure out how
>> I can pass the
>> > URL
>> > information to iText as I am passing the graphics2D object?
>> >
>> > Following is a sample code:
>> > ---------------------------------------
>> > Document doc = new Document(pageSize);
>> > PdfWriter writer = PdfWriter.getInstance(doc, out);
>> > doc.open();
>> > PdfContentByte cb = writer.getDirectContent();
>> >
>> > //
>> > for( int i = 0; i < numberOfPages; i++ )
>> > {
>> >       //PDFPage page = doc.appendNewPage( width, height );
>> >       doc.newPage();
>> >       PdfTemplate tp = cb.createTemplate(width, height);
>> >       Graphics2D g2D = tp.createGraphics(width, height, new
>> > DefaultFontMapper());
>> >
>> >       printableObject.print( g2D, pageFormat, i );
>> >       cb.addTemplate(tp, 0, 0);
>> > }
>> > doc.close();
>> > -----------------------
>> >
>> > Is there any way I can pass the URL information so that
>> iText can create
>> > the
>> > table elements with hyperlinks?
> 
> 
> Aviso Legal:
> 
> Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
> informação confidencial ou legalmente protegida. A incorrecta transmissão
> desta mensagem não significa a perca de confidencialidade. Se esta
> mensagem for recebida por engano, por favor envie-a de volta para o
> remetente e apague-a do seu sistema de imediato. É proibido a qualquer
> pessoa que não o destinatário de usar, revelar ou distribuir qualquer
> parte desta mensagem. 
> 
> 
> 
> Disclaimer:
> 
> This message is destined exclusively to the intended receiver. It may
> contain confidential or legally protected information. The incorrect
> transmission of this message does not mean the loss of its
> confidentiality. If this message is received by mistake, please send it
> back to the sender and delete it from your system immediately. It is
> forbidden to any person who is not the intended receiver to use,
> distribute or copy any part of this message.
> 
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> 

-- 
View this message in context: 
http://www.nabble.com/Create-text-URL%27s-within-document-created-using-Graphics2D-tp19042664p19402777.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to