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>
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,
^ _ ^
Copy link to clipboard
Copied
Thank you for reply,
I tired all ways. It's not working .
ColdFusion Version 2016
Copy link to clipboard
Copied
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,
^ _ ^