Skip to main content
Participant
September 7, 2018
Question

Custom css not working in cfddocument and cfhtmltopdf

  • September 7, 2018
  • 1 reply
  • 884 views

Hi,

Custom CSS is not working in cfddocument and cfhtmltopdf,

For Example: SentinelBook , I installed fonts in windows server and ColdFusion administrator font management as well.

Paths everything is correct. It's working in browser but not  working in cfddocument.

Please help on this solution.

<cfdocument format="pdf" backgroundvisible="yes" pagetype="a4"  fontembed="no" localURL="yes"  >

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

<!---<link  href="../fonts/styles.css" rel="stylesheet" type="text/css" />--->

<style>

@1552174 url("..fonts/styles.css");

@11220649-face {

    font-family: 'SentinelBook';

    src: url('sentinel-book-webfont.eot');

    src: url('sentinel-book-webfont.woff') format('woff'), url('sentinel-book-webfont.ttf') format('truetype'), url('sentinel-book-webfont.svg#webfontQQCqhvKp') format('svg');

    font-weight: normal;

    font-style: normal;

}

</style>

</head>

<body>

<div>

<span style="font-size:40px;color: #003865;font-weight:800;font-family: 'Sentinel-Book' ; ">Test cfdocument cfdocument 123456 </span> <br />

</div>

</body>

</html>

</cfdocument>

    This topic has been closed for replies.

    1 reply

    WolfShade
    Legend
    September 7, 2018

    I rarely work with cfdocument or cfhtmltopdf, but I don't think that the @import will work.  Have you tried copying/pasting the contents of the fonts/styles.css file into the style area?

    HTH,

    ^ _ ^

    Participant
    September 7, 2018

    Thank you for reply,

    I tired all ways. It's not working .

    ColdFusion Version 2016

    WolfShade
    Legend
    September 7, 2018

    Submit a bug report, I guess.  If you're including ALL of the css (including the font-face stuff) within your <style> tags and it still doesn't work, it could very well be a bug.

    V/r,

    ^ _ ^