Developer forum

Forum » CMS - Standard features » Custom font in PDF

Custom font in PDF

Jesse Bakker
Reply

Hi,

When generating a Pdf with the PDF=true parameter, how can we add a custom font to the generated pdf.

We've installed the font on the server, when viewing in the browser on the server it shows the correct font. But on the pdf output it is not there.

Are there certain steps to take to get this working?

 

 


Replies

 
Nicolai Pedersen
Reply

Hi Jesse

You would have to visit the ABCpdf documentation for information related to this - DW uses the MSHTML rendering engine. Remember that the server caches hard, so you probably need to iisreset and empty abcpdf cache (windows temp files) before you can see the change for the same URL. Or use another URL to test.

In Dynamicweb 9.7 that releases end of August, the PDF engine is switched to a version that uses Chrome and supports webfonts etc. Will make tasks like this much easier.

BR Nicolai

 
Jaap Tinholt
Jaap Tinholt
Reply

At the moment we still have the same problem but now with IronPDF.

I used these styles, as were given in the documentation of IronPDF 

  <style>
@@font-face {
          font-family: 'Bangers';
          font-style: normal;
          src: url('/Files/Templates/Designs/BackYard/GoogleFont/Bangers/BANGERS-REGULAR.TTF');
        }
  header{
      font-family: 'Bangers', sans-serif;
font-style: normal;
      color: blue;
      }
      h1 {
      font-size: 50px;
      }
  </style>
 
Can you help?

 

You must be logged in to post in the forum