DocRaptor HTML TO PDF API

Custom Fonts & Web Fonts

Custom fonts are easy to do in DocRaptor. They work just like using fonts on the web, using @font-face selectors. Here's an example of what Google Web Fonts generates for Open Sans:

<style>
@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 200;
    src: url(https://fonts.gstatic.com/s/opensans/v18/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2) format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
html { font-family: 'Open Sans', sans-serif; }
</style>

Note: WOFF 2.0 support requires DocRaptor Pipeline 8 or higher. See our release notes here.

Ready to get started? Try DocRaptor for free with unlimited test documents.