English 中文(简体)
iReport exported pdf does not show correct font
原标题:

A PDF generated in iReport using the Times New Roman font appears to be using Arial for its print version.

Any idea what the problem is?

最佳回答

I ve found that, at least for me, I must explicitly set the pdfEncoding attribute, as well as pdfFontName and isPdfEmbedded, on each font tag in the xml, even when using the system encoding, and that "Identity-H" seems to be needed when using unicode.

So:

  1. Make sure your ttf font files are available on the classpath
  2. <font ... pdfFontName="filename.ttf"
  3.    isPdfEmbedded="true"
  4.    pdfEncoding="Identity-H" ... />
问题回答

have you set the PDF Font Property to Times New Roman as well, or just the Font property?

Have you tried adding your system fonts directory to the classpath?





相关问题
Using a POJO as an iReport data source

I have a POJO that compiles data from various sources into a single object. The object is instantiated with a single parameter. Example: Invoice inv=new Invoice(1239); This will bring back a ...

Problem with auto page break in iReport

I m using iReport 3.7. I have a report with two subreports (order details and some selling statistics), and a grouping by seller. One subreport is located in the Detail band of the group, and the ...

How to truncate data (avoiding page break) in iReport?

I have a listing that must fit in a page. Instead of the default page break behaviour, I need iReport to truncate the listing when it goes over the page size. Any ideas? Thanks! EDIT: I ve had ...

How to prevent duplication of bar chart in iReport

I ve tried to use chart in iReport for the first time. I ve used a bar chart and anytime I preview the chart I see plenty of them, iIthink about 6. I only need a single one is there anything that I ...

Field Expression in iReport

I m trying to get myself used to iReport before using it in a real project next week and i seem to be stacked somewhere already. I m using iReport 3.7.0 on Windows XP platform + Java 1.6 It sound ...

热门标签