I also have this problem printing from JasperReports. I have had a
look at the PDF file and found the spacing to be that of the font and
size I declared in the report definition, but the font actually
printed to PDF was Lucida Grande 12pt, no matter which font I
requested. So the character placement is done with the correct font.
int yPosition = 100;
int fontSize = 8;
while (fontSize <= 14) {
g.setFont(new Font("Arial", Font.PLAIN, fontSize));
g.drawString(fontSize + "pt Arial: The quick brown fox
jumped over the lazy old dog.", 100, yPosition);
yPosition += 50;
fontSize++;
}
return PAGE_EXISTS;
}
}
which seems to be consistent to what Raffi Minassian reported:
Peter Mycue from DBSolutions, Inc. was kind enough to share the
following
info with me about this issue...
" ... the root problem seems to be that the font context is not
updated when
you change fonts in a graphics context."
By the way, calling JasperExportManager.exportReportToPdfFile works
perfectly, only JasperPrintManager.printReport does not.
In Jasper, JRXmlDigesterFactory, I found these conspicously looking
lines:
Why is setFont commented out? Removing the comment does not help, of
course.
While this does not solve the problem, it might shed a little bit more
light on it.
Kind regards,
Bernd Gründling _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden