K
K
kirigosh2021-07-21 09:21:36
css
kirigosh, 2021-07-21 09:21:36

How to assign custom font in sejda htmlToPDF?

Hello. There is a service that converts HTML to PDF, but it does it through its own server: https://www.sejda.com/developers#html-pdf-api . It rejects all the fonts that I would give it, but swallows it without problems Google fonts. If you throw him a link to the Roboto font in Google Fonts, then everything is fine, but if you put him like this:

/* cyrillic-ext */
@font-face {
  font-family: 'myfont';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('roboto-v27-latin_cyrillic-regular.eot'); /* IE9 Compat Modes */
  src: local(''),
       url('roboto-v27-latin_cyrillic-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('roboto-v27-latin_cyrillic-regular.woff2') format('woff2'), /* Super Modern Browsers */
       url('roboto-v27-latin_cyrillic-regular.woff') format('woff'), /* Modern Browsers */
       url('roboto-v27-latin_cyrillic-regular.ttf') format('truetype'), /* Safari, Android, iOS */
       url('roboto-v27-latin_cyrillic-regular.svg#Roboto') format('svg'); /* Legacy iOS */
}

Then he will not care and he will not display it at all (there will be the default Times new roman). Tell me what to do?

ps you can register on the Sejda service through Yandex mail, but you need to specify the @ya.ru domain there

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question