views:

451

answers:

3

Hi,

A PDF I generate with jasper reports renders Ok in my MAC but some labels show wrong on Linux. For example, I have a static label that doesn't show completely on linux (only a part of the whole word) but yes on Mac. Can the OS be somehow related? What is the usual source of this kind of problems?

+3  A: 

Missing fonts on your linux machine may cause such problems. I had the same when creating pdfs with iText.

Florian Gutmann
But it is not like the whole document can't be seen. Its only one static label that doesn't show the complete text and it also happens that a whole row of the detail section doesn't show up at all. Could this behaviour be still font-related?
spderosso
Yep, I guess it's still font related, sometimes wrong font or wrong font encoding could render the whole report unreadable. For checking, use system fonts that are also compatible with PDF. In the bottom of the Properties of the TextField, there is something called "PDF Encoding", check that as well.
medopal
A: 

Always embed fonts in generated PDFs! It saves you alot of hassles...

And notify the following slight difference: If you create a PDF with Arial as font it shows good in Windows, and will very likely use Helvetica on Linux (which is nearly the same font), but since it has some other metric properties your bounding boxes will not fit.

Again: Always embed fonts in generated PDFs!

Daniel
A: 

If you have time you can look at Docmosis, it generates PDFs with the fonts embedded, so cross-platform rendering isn't an issue. Beware though if you cross-platform generate doc or odf files, then the fonts will be potentially different showing up in pagination or layout changes. Like has been said above, you need to take care that the destination will have the fonts to display those that were used to generate the document (or embed the fonts if possible).

jowierun