XML4Pharma wrote:
> I am new to iText and do not know much about PDF structure (yet).
>  
> I have a Swing application that creates and shows a complex JPanel.
>  
> I have been able to transform the JPanel to PDF. It works great, but (of 
> course) I am loosing the panel's components tooltips.

AFAIK tooltips aren't supported in PdfGraphics2D.

> Is there a way to add them again afterwards ?

Yes, but you need to know the coordinates.
I think you don't have that information.

> I do know I can add tooltips in the PDF by using the Chunks, so I tried:
> java.util.ArrayList chunks = document.getPageSize().getChunks();

Er... page size is a Rectangle. It's a set of 4 values: x1, y1, x2, y2.
No Chunks there...

> Is there something I am doing wrong (as a novice) - or can't it be done 
> anyway as I am using Graphics2D ?

I repeat: I don't think it's implemented in PdfGraphics2D
(but maybe I'm wrong).

> If it cannot be done, is there any possibility to get the coordinates 
> (and sizes) of the objects in the PDF, and in that way add a tooltip ?

No, it's not possible to "get the coordinates of the objects in the 
PDF". You have a better chance implementing tooltips in PdfGraphics2D.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
iText-questions mailing list
[email protected]
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