Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Custom fonts in report
posted

im generating a pdf report in which i want to use a non standard font.
I installed the font on the webserver and included the font in a Style, but it isn't being used in the report.

I thought that when you generate a pdf all the object you insert into it are then embedded in the file. Just like the images. Is this not so?

I tried using the FontLoader of my report object, but keep getting a 'ref. not set ' error. 

So how do i use my own fonts in a report?

Thanks.

Parents
  • 1171
    posted

    The fonts aren't automatically embedded into the document because it makes the document size much bigger.

    You have two options if you want to use a custom font. You can install it on your webserver and then set the DocumentExporter's Resources.FontsEmbedded property to All.  Then all of the fonts used in the document will be embedded.

    Alternatively, you can make the font's file available somewhere that the application can access and provide the path to the DocumentExporter by setting its Resources.FontDirectory property. Then you can either set the FontsEmbedded property to All, to embed all fonts or to ResourceFontsOnly, to only embed the ones that are in the FontDirectory. The advantage of doing this is that you don't need to actually install the font on the web server and it means that only the fonts that aren't likely to be on the end user's system will need to be embedded. 

Reply Children