Hi,

I'm new to itext and creating pdf's with it, so it may look like i'm a
little confused :-)

I would like to add a tooltip to my pdf, much in the same way hyperlinks
have those yellow tooltips when you hover over them with the mouse. But
i don't want the hyperlink, i just want the tooltip.

I'm using jasperreport to create the pdf, but i'm at the point of
writing my own PdfExporter so i'm really using the iText API.

When i use

PdfAnnotation.createSquareCircle(pdfWriter, pxImage,
link.getHyperlinkTooltip(), true);

i get the following "pdf code" :

<</Contents(my tooltip text)/Subtype/Square/Rect[385 311.89 405 325.77]>>

This gives me a tooltip, but with an empty title, different font and
white background.

By experimenting, i found that ...

<</Rect[385 371 405 386]/Subtype/Widget/TU(my tooltip text)
            /H
            /P
            /P 12 0 R
            /T(tom)
            /FT
            /Btn
                                  /AP
            <</N 297 0 R>>>>

... does almost what i want. Right color, right font. But i get an error
in acroread when opening the document. The error flashes to fast to read
what it actually says, but i except it has something to do with the code
/H /P /P ... that i don't understand.
Also, i don't have a clue on how to get to that code from itext.

Can someone

A. explain what all those pdf tags in the second example mean...
B. generate them with the itext api
or C. tell me how to alter the first example to get the same sort of tooltip

Thanks


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
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
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