1

i am using NReco.PdfGenerator to generate pdf from html. I would like to change the font-family of the pdf. I have a custom font and add it in html and it does not work.

<head>
<style>
    @font-face {
        font-family: 'Helvetica LT W01 Condensed';
        src: local('Helvetica LT W01 Condensed'), url(../EmailTemplates/Helvetica-LT-W01-Condensed.woff2) format('woff2');
    }
</style>

But if I try to add another font from Google, it works.

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Sans+Narrow" type="text/css">

Do you have any ideas? Thanks.

Vitaliy Fedorchenko
  • 8,447
  • 3
  • 37
  • 34
ichau
  • 41
  • 1
  • 6
  • you probably also want to ask the NReco people this over on https://www.nrecosite.com/contact.aspx and then maybe you can even supply the answer yourself if they respond, to help future visitors that find this quesiton. – Mike 'Pomax' Kamermans Mar 09 '17 at 17:09

1 Answers1

0

If you use HtmlToPdfConverter.GeneratePdf method that accepts HTML template as a string please ensure that all URLs in the HTML are absolute.

If this doesn't help, try to use ttf or woff font instead of woff2.

Vitaliy Fedorchenko
  • 8,447
  • 3
  • 37
  • 34