Hi, we have been using JasperReports solution and iText PDF export on WebLogic
8.1 (JRocket 4, RedHat Linux) for several years.
We wanted to upgrade to 9.2 server (JRocket 5, RedHat Linux).
But we noticed very bad behavour. Text fields printed using Windows True Type
Times New Roman font sometimes dissappear (mostly Bold font only).
Arial fonts have no problem. This problem occurs sometimes just after
application deploy, sometimes after several weeks of running.
When it starts, no Times font field is shown forever.
We tried iText 1.3.1, then 2.0.8. with the same result. JasperReport 2.0.4 has
the same problem.
Just server restart helps in most cases. Font must be available, else some
exception should be thrown.
Could it be BEA deployment problem or some logical/physical mapping problem
(ttf vs. TTF, etc.)?
We are not sure, if we could replace Times New Roman font with different one to
fix problem.
Is there anybody with BEA 9 and the same problem?
Regards,
Libor
Short sample:
...
private Font getPDFFont() throws Exception
{
InputStream is = null;
Font font = null;
is = this.getClass().getResourceAsStream("/TIMESBD.ttf");
int flen = is.available();
byte[] b = new byte[flen];
is.read(b, 0, flen);
final BaseFont fnt = BaseFont.createFont("TIMESBD.ttf",
BaseFont.IDENTITY_H, BaseFont.EMBEDDED, true, b, null);
font = new Font(fnt, 12, 0, new Color(255, 0, 0));
return font;
}
public byte[] getPDFDoc(String msg) throws Exception
{
final ByteArrayOutputStream out = new ByteArrayOutputStream();
// step 1: creation of a document-object
final Document document = new Document();
// step 2: creation of the writer-object
PdfWriter.getInstance(document, out);
// step 3: we open the document
document.open();
// add text
Chunk chunk = new Chunk(msg, getPDFFont());
document.add(new Paragraph(chunk));
// step 5: we close the document
document.close();
out.flush();
return out.toByteArray();
}
...
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar