Coldfusion doesn't display installed font in PDF

892 Views Asked by At

I installed Helvetica Neue Thin in Fontmanagement of Coldfusion 2016 (64-Bit). The installation havn't any error, but the font doesn't display in PDF. I have Barcode font, which installed and work perfectly. The Question is : Need the Font special license to display it on Webpages? if yes, how Barcode Font work perfectly (without any special license).

1

There are 1 best solutions below

0
On

Which version of ColdFusion?

Are you sure that "Helvetica Neue Thin" is the system name of the font? (We've had some issues where the system font name is slightly different.)

Is it TrueType? (We've had the best success using TrueType with CFDocument.)

Try this CFML (from Tim Cunningham) to expose system font information:

<cfset adminObj = createObject("Component", "cfide.adminapi.administrator")>
<cfset adminObj.login("yourpass")> <!--- change to use your CF Admin password --->
<cfset rtService = createObject("component", "cfide.adminapi.runtime")>
<cfset fonts = rtService.getFonts()>
<cfdump var="#fonts#">

If the font is still not embedded, I believe it could be due to a licensing issue where the font can't be embedded.

SIDE NOTE: For the past couple years, I've been performing all ColdFusion 8-2016 PDF generation using the command line and WKHTMLTOPDF. WKHTMLTOPDF understands newer CSS3 (page-break-inside, page-break-before, fontawesome) & HTML5 specifications, SVG and renders javascript & webfonts! This means you can easily use any font without ever having to install it on the server. There are a couple of ColdFusion tags that make WKTHMLTOPDF easier to use. I've also blogged about WKHTMLTOPDF & ColdFusion.