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.
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.
i still have not found the answer how to embed my fonts in a pdf report (Infragistics.Documents.Report.Report)
when i instantiate the Infragistics.Documents.Report.Report class, i found the FontLoader function, but it always seems to return 'Object reference not set to an instance of an object.'
How do i use this function or how do i embed custom fonts in a other way?
Hi,
thanx for the reply.
But it seems that this solution relies on the use of the UltraWebGridDocumentExporter to export data from a UltraWebGrid.
When generating my pdf document's im not using a webgrid to gather my data, but the Infragistics.Documents.Report.Report class to generate it from scratch.
i have seen that when i instantiate this class i has a FontLoader.load() and a Fontloader.FontMapper.MapFont(). But when i try to reference my fonts i keep getting a null reference error.