Custom css not working in cfddocument and cfhtmltopdf

New Here ,
Sep 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

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>

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

@font-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>

Views

384

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

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,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

Thank you for reply,

I tired all ways. It's not working .

ColdFusion Version 2016

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

LATEST

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,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines