• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

707

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,

^ _ ^

Votes

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

Votes

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,

^ _ ^

Votes

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
Resources
Documentation