Welcome Guest Search | Active Topics | Sign In | Register

Century Gothic font is not rendered Options
Eddy Ng
Posted: Tuesday, June 25, 2013 4:19:14 PM
Rank: Newbie
Groups: Member

Joined: 11/27/2012
Posts: 5
I used HtmlToPdf.ConvertUrl to convert my HTML page to PDF. My page refer to the CSS file with the following style:

body {
background-color: white;
font-family: Century Gothic, sans-serif;
margin: 0;
padding: 0;
}

In the browser, the Century Gothic font shows up just fine. When converted to PDF, the Century Gothic font is not being used. I saw another posting in the forum that mentioned that the font must be installed. I made sure that the font is installed in my server and the century gothic is still not rendered. Am I missing something?
eo_support
Posted: Tuesday, June 25, 2013 4:24:12 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Please try to enclose your font name inside quotations. For example:

font-family: "Century Gothic"

Thanks!
Eddy Ng
Posted: Tuesday, June 25, 2013 4:43:52 PM
Rank: Newbie
Groups: Member

Joined: 11/27/2012
Posts: 5
I tried that and it didn't work either. One thing come into mind. Do I have to reboot the machine after installing the font before HtmlToPdf can use it? If yes, is there anyway to avoid that? This is production server and I don't want to reboot it if not necessary.
eo_support
Posted: Tuesday, June 25, 2013 4:55:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

There is no way to prevent reboot on our end. We call a Windows API to get the font data and if Windows doesn't give it to us for whatever reason, we can't do anything. However the new version (2013) has a new feature that allows you to use custom font. Custom font allows you to reference the font file directly through a Url with @font-face CSS attribute without having to install the font on the server. That should solve this kind of problems for you. However even if the new version works for you, you would still need to reboot the server (or at least your server app) once when your app switch to the new version.

Thanks!
Eddy Ng
Posted: Tuesday, June 25, 2013 5:39:45 PM
Rank: Newbie
Groups: Member

Joined: 11/27/2012
Posts: 5
OK.. I'll reboot the server this weekend. My next question is regarding the new feature of referencing the font using the URL. One of our site uses the Open Sans font as described in this page:

http://www.google.com/fonts#UsePlace:use/Collection:Open+Sans

Can I use the above font when exporting to PDF? Right now, I loaded the font using javascript as described in the above page. And HtmlToPdf didn't render the font. Thanks.
eo_support
Posted: Tuesday, June 25, 2013 8:39:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

We tested it and it works fine. We added the following line into the header section:

Code: HTML/ASPX
<link 
    href='http://fonts.googleapis.com/css?family=Open+Sans' 
    rel='stylesheet' type='text/css'>


And the font will be loaded by the converter. Note that this is a new feature that was just added. So you may want to check whether you are trying this on the latest build.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.