Since The class PDFGraphics instanciate JFrame in getFontMetrics method
there is a problem to use gnujpdf on a web server.
On linux I got message:
X11 display not available
On windows it works a moment but After severals use of the lib I got :
Out of memory no more window handle.
Here is my suggestion for getFontMetrics :
Line 1435 :
public FontMetrics getFontMetrics(Font font) {
BufferedImage image = new
BufferedImage(100,100,BufferedImage.TYPE_INT_RGB);
// Frame dummy = new Frame();
// dummy.addNotify();
// Image image = dummy.createImage(100, 100);
if (image == null) {
System.err.println("getFontMetrics: image is null");
}
Graphics graphics = image.getGraphics();
return graphics.getFontMetrics(font);
}
I tested this and it works well.
Nobody/Anonymous
None
None
Public
|
Date: 2007-11-23 09:26
|
| Filename | Description | Download |
|---|---|---|
| PDFGraphics.java | Final version that works | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| File Added | 255538: PDFGraphics.java | 2007-11-23 09:26 | pdeville |
| File Deleted | 254906: | 2007-11-23 09:26 | pdeville |
| File Added | 254906: PDFGraphics.java | 2007-11-19 05:51 | pdeville |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use