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.

Is there a way to add them again afterwoods ?

The code I have been using is:

document.open();
PdfContentByte cb = writer.getDirectContent();
PdfTemplate tp = cb.createTemplate(width, height);
Graphics2D g2d = tp.createGraphics(width, height, new DefaultFontMapper());
comp.print(g2d);
g2d.dispose();
cb.addTemplate(tp, 0, 0);
...
document.close();

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

but get an empty ArrayList.

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

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 ?

Any help is appreciated.

Best regards,

Jozef Aerts
XML4Pharma

------------------------------------------------------------------------------
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