+ Start a Discussion
JntshumakerJntshumaker 

Making text bold in a PDF

I'm attempting to use CSS to make text bold within a PDF that is generated off of a custom object, below is a snippet of my css and the portion of the PDF code where that style is called, i've also tried just surrounding the text in

 

 

<b></b>

 

 

Below is the snippet:

 

 

  p {
    font-size:10pt;
    font-family:Arial Unicode MS;
    font-weight:bold;
  }

....

<p>
<b>First Heading</b>
</p>

 

 

chandra2ravichandra2ravi

 

Try this i hope this help u..
<p style="font-size:10pt;font-family:Arial Unicode MS;font-weight:bold;">
<First Heading
</p>

 

JntshumakerJntshumaker

Thank you for the reply, i applied the suggested code to no avail, i've read some things that this may be unique to the conversion from visualforce to PDF, that some things can be stripped.  Just thinking this is a pretty simple ability that would be needed.

Joshua LuttmerJoshua Luttmer
I've tried a bunch of different things also.  I am trying to bold only a part of a sentence and tried using <b> <strong> <bold>.  All appear fine on VF Page however when I convert to PDF it strips the Arial Font and reverts back to Times....  Has anyone found a work around to this yet?
MikesForceMikesForce
This one seems to be working; just achieved a bold output in the PDF. Yeah!
https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000A7RqZSAV

'<span style="font-family: sans-serif; font-weight:bold;">'+Opp.ProjectID__c+'</span>' // -- works
'<span style=\"font-family: sans-serif; font-weight:bold;\">'+Opp.ProjectID__c+'</span>' // -- works
'<span style=\"font-weight:bold;\">'+Opp.ProjectID__c+'</span>'  //-- does not work without the font-family set

1) I used a <span> instead of the <div> in the example but that works, of course.
2) There is a   \   before the   "  double quotes in the exmaple; both having or ommitting this seems to be working
3) not having the font-family set as such appears to be a show stopper - does not work.

This is my very recent experience. Just added this comment if you find this post before the one mentioned at the top of mine.