Skip navigation
bcreedy
Currently Being Moderated

cfdocument: font not rendering

Sep 26, 2010 3:20 PM

Hi: I have a webpage that prints a photo with text underneath that is in specific fonts.

 

This works fine when it is rendered as a normal webpage: the fonts display exactly as they should, but when I wrap the code with a CFDOCUMENT tage the fonts revert to standard fonts i.e., the wrong donts.

 

I'm tearing my hair out. Does anyone have any ideas?

 

thanks.

 

..Robert

 

Here's the code:

 


<cfdocument format="pdf" fontembed="yes" filename="aaa.pdf"  overwrite="true">

 

<?xml version="1.0″ encoding="UTF-8″?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XHTML-document</title>

 

<meta http-equiv=Content-Type content="text/html; charset=windows-1252" />
<meta name=Generator content="Microsoft Word 12 (filtered)" />
<style type="text/css">

 

@font-face
    {font-family:"Cambsdfria Math";
    panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
    {font-family:Calibri;
    panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
    {font-family:"Gotham XNarrow Bold";
    panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
    {font-family:"Gotham XNarrow Book";
    panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
    {font-family:"Gotham XNarrow Black";
    panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
    {font-family:AngssdfanaUPC;
    panose-1:2 2 6 3 5 4 5 2 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
    {margin-top:0cm;
    margin-right:0cm;
    margin-bottom:10.0pt;
    margin-left:0cm;
    line-height:115%;
    font-size:11.0pt;
    font-family:"Calsdfibri","sans-serif";}
.MsoPapDefault
    {margin-bottom:10.0pt;
    line-height:115%;}
@page WordSection1
    {size:612.0pt 792.0pt;
    margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
    {page:WordSection1;}

 

</style>

 

</head>

 

<body lang=EN-CA>

 

<table width="155" border="0" cellpadding="0" cellspacing="0">

 

<tr>
    <td align="center" width="144" height="77" colspan="3"><!img src="052498.jpg" WIDTH="144" HEIGHT="77" border="0" />
    <embed width="144" height="100" src="W1936758.tif" type="image/tiff" /></td>
</tr>

 

<tr>
    <td width="3"></td>
    <td align="center" width="138" height="11"><span style='font-size:9pt;font-family:"Gotham XNarrow Bold"'>14 First Street</span></td>
    <td width="3"></td>
</tr>

 

<tr>
    <td width="3"></td>
    <td align="center" width="138" height="11"><span style='font-size:11pt;font-family:"Gotham XNarrow Black"'>$599,900</span></td>
    <td width="3"></td>
</tr>

 

<tr>
    <td width="3"></td>
    <td align="center" width="138" height="11"><span style='font-size:9pt;font-family:"Gotham XNarrow Book"'>145 sq ft, two-storey, 3 bedrooms, 2 baths, full fin basement, more details to come.</span></td>
    <td width="3"></td>
</tr>

 

<tr>
    <td width="3"></td>
    <td align="center" width="138" height="11"><span style='font-size:9pt;font-family:"Gotham XNarrow Bold"'>Mark Jones</span></td>
    <td width="3"></td>
</tr>

 

<tr>
    <td width="3"></td>
    <td align="center" width="138" height="11"><span style='font-size:9pt;font-family:"Gotham XNarrow Bold"'><em>Realty Office</em></span></td>
    <td width="3"></td>
</tr>

 

</table>

 

</body>
</html>

 

</cfdocument>

 
Replies
  • Currently Being Moderated
    Sep 26, 2010 7:46 PM   in reply to bcreedy

    Is the font installed on the server, or only on your computer? If you

    want CF to embed a font, the CF server needs to have access to the

    font. Check CFAdmin for a list of fonts that ColdFusion knows about.

     

    -Mike Chabot

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2010 12:46 PM   in reply to bcreedy

    Acrobat Reader will lists the fonts that are contained in a PDF

    document (File > Properties > Fonts). Is there any trace of the font

    you want in that list, or is it missing? If the font is in the list is

    there a note next to the name saying "embedded?"

     

    -Mike Chabot

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2010 5:26 PM   in reply to bcreedy

    Maybe try the basic HTML font tag instead of style sheets to see if

    that helps with the font embedding.

     

    -Mike Chabot

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 27, 2010 2:46 AM   in reply to bcreedy

    Hi,

     

    Is it possible to embed fonts from an external source into cfdocument?  For example, I have tried the following but it didn't work.

     

    <cfdocument fontembed="yes" format="pdf">

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Test</title>

     

    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">

    </head>

    <body>

    <div style="font-family:'Tangerine';">Testing 123</div>

    </body>
    </html>
    </cfdocument>

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 24, 2010 11:57 PM   in reply to minli98

    I may be wrong, but we had a similar issue recently - try playing around with how you name the font in your CSS going into cfdocument. In CF Admin under Font Management each font has three names - "Font Family", "Font Face" and "Postscript Name" - I believe if you're using the wrong one in your CSS then it won't embed properly.

     

    Might not be the fix, but it's a simple one to test.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points