Jump to content
Changes to the Jaspersoft community edition download ×

How to get bold text in PDF?


2005 IR Help

Recommended Posts

By: C-Box - c-box

How to get bold text in PDF?

2004-09-07 08:03

Hi,

 

just a simple problem but I can't see a simple solution, or my eyes are too tired already:

 

I've many elements that are printed very well in JasperViewer - but when I save the whole JRPrint as PDF, then all the bold elements are just normal (non bold) ..... so I set the "isPdfEmbedded" of all my bold elements to true.. but nothing changed.... in preview OK in PDF not ok......

 

the only way I got it bold in a PDF was to set the PDF-Font to "Helvetica-Bold" instead of "Helvetica"....

Sure you can say, that's it..... but in my eyes that's not a good solution... I (or one of the customer) don't remember in some weeks to change the font to another when I want to have some elements in bold. I just click the checkbox "bold" (in iReport) and that's it. And it should come in bold also when I export to PDF.

 

Is there another solution instead of changing to "helvetica-bold" as pdf-font ???? I don't want to write a method that changes all bold-elements to pdffont "Helvetica-Bold" before filling the report.

 

tia

C-Box

 

 

 

 

By: Mykel Alvis - evilarchitect

RE: How to get bold text in PDF?

2004-09-08 08:39

I feel your pain. I'm having my own font issues today. And you're right. It's a poor solution.

 

I was under the impression that embedding the font did the trick. Maybe you'd want to see how this is happening in the code with regard to itext and take the discussion up with the itext folks.

 

 

 

 

By: Paulo Soares - psoares33

RE: How to get bold text in PDF?

2004-09-08 08:50

I think that JR needs something like iText's FontFactory. The fonts are registered and to get the right font you supply the family name and the modifiers (bold, italic). Works for any font and even for the CJK ones can take care of the bold simulation. The built-in fonts are automatic registered and for the truetype ones just supply the directories.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...