FlexReport for WPF | ComponentOne
In This Topic
    Embedding Fonts
    In This Topic

    Font embedding feature available in FlexReport, allows you to embed default or preinstalled fonts in the reports or .flxr files. Now, when that file is loaded on a different system, fonts that have been used or embedded while designing of file is ensured to render correctly on another system. Embedding of fonts in FlexReport is done using the Save(string fileName, bool embedImages, bool embedSubReports, bool saveAll = false, FontEmbedType embedFonts = FontEmbedType.Auto) method available in FlexReport class. The description of parameters of the Save method used for embedding the font in report is as follows:

    If the value of saveAll parameter is set to true then FontEmbedType.Auto does not work.

    To embed fonts in a report, an object of the FlexReport class is created with the name report. Then, the report object calls the Load method to load the report. The Load method takes two arguments i.e. fileName and reportName to load a report from the file. After embedding fonts in the file, the file is then saved with the name Result.flxr using the Save method. Following code snippet allows you to save the report with fonts embedded in it:

    C#
    Copy Code
    private void Save_File(object sender, RoutedEventArgs e)
    {
        FlexReport report = new FlexReport();
        report.Load("Samplefont.flxr","New Report");
        report.Save("Result.flxr",true,true,false,FontEmbedType.Auto);
    }