Yes, you do need to show the component in order for it to lay itself out. I isn't painted until you show it.
-Bill Ensley Bear Printing -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Avelino Herrera Sent: Friday, November 05, 2004 3:55 AM To: [EMAIL PROTECTED] Subject: [iText-questions] A problem with Graphics2D fonts Hi, all. I'm trying to build a JPanel subclass (named JPanelPDF) that includes a custom "printPDF" public method to write the JPanel to a PDF document ussing Graphics2D returned by "PdfContentByte.createGraphics(w, h, mapper)". The idea is to design any JPanelPDF subclass with a WYSIWYG GUI editor (such as JDeveloper, NetBeans, etc) and, directly do a "panelObject.printPDF(outputStream)" at runtime. The object runs ok but it must to be showed previously to be printed to the PDF (?). If i directly call the panel's printPDF method the output PDF document only contains the non-text objects but if i shows previously the panel in any container (such a JFrame or JDialog) and then call panel's printPDF method, the output PDF document is ok (with lovelly vectorial fonts :-) ). I am ussing TrueType fonts (calling "DefaultFontMapper.insertDirectory(...)") and at design time, in JDeveloper, i can see the fonts correctly since i do a "Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(path))" to get the adecuate "java.awt.Font" objects. Thanks in advance. Avelino Herrera ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions