.Net Core Web API deployed on Kubernetes - missing 'Verdana' font

Hi there! I’m running into an error while trying to generate a pdf on a kubernetes cluster.
I copy the ttf Font files to /usr/share/fonts/truetype/msttcorefonts, as specified here:

Basically, this is a part of my Dockerfile
RUN mkdir -p /usr/share/fonts/truetype/msttcorefonts
COPY bin/Release/netcoreapp3.1/linux-x64/publish/Resources/Verdana.ttf /usr/share/fonts/truetype/msttcorefonts
COPY bin/Release/netcoreapp3.1/linux-x64/publish/Resources/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts

WORKDIR /App

RUN install -m644 ./Resources/Verdana.ttf /usr/share/fonts/truetype/msttcorefonts
RUN install -m644 ./Resources/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts

But I also tried
RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig

  • Which prompts me to accept EULA agreement, so I tried several variations, among which:
    RUN apt-get update && apt-get install -e “ACCEPT_EULA=Y” -y ttf-mscorefonts-installer fontconfig - but didn’t do the trick.

I’m not a linux/docker expert, otherwise I assume I would’ve managed by now.

I’m wondering, what’s the best course of action, how can I easily install these fonts?
Any help would be greatly appreciated!

Best Regards,
Rystad Energy

@rystadenergy

We will try to arrange a sample docker file for you in order to prevent the issue that you are facing. Meanwhile, would you please sample code and files for reference so that we test as well?

Hi there, I forgot to mention that I’m generating a PDF from a html.
I found a workaround - I simply removed the ‘Verdana’ font specification when adding a watermark and page count stamp. Afterwards it simply works as it should (I still use Verdana as a font-family in the CSS, but that doesn’t seem to cause issues).
I guess you can close this case, unless you have some specific guidance that might be useful in the future.

Best Regards

@rystadenergy

It is nice to know that your issue has been resolved. Please keep using our API and feel free to let us know in case you face any issues.