Пример #1
0
        public void FontSettingsWithLoadOptions()
        {
            //ExStart:FontSettingsWithLoadOptions
            FontSettings fontSettings = new FontSettings();

            TableSubstitutionRule substitutionRule = fontSettings.SubstitutionSettings.TableSubstitution;

            // If "UnknownFont1" font family is not available then substitute it by "Comic Sans MS"
            substitutionRule.AddSubstitutes("UnknownFont1", new string[] { "Comic Sans MS" });

            LoadOptions loadOptions = new LoadOptions();

            loadOptions.FontSettings = fontSettings;

            Document doc = new Document(MyDir + "Rendering.docx", loadOptions);
            //ExEnd:FontSettingsWithLoadOptions
        }
Пример #2
0
        static void FontSettingsWithLoadOptions()
        {
            // ExStart:FontSettingsWithLoadOptions
            // The path to the documents directory.
            string                dataDir          = RunExamples.GetDataDir_WorkingWithDocument();
            FontSettings          fontSettings     = new FontSettings();
            TableSubstitutionRule substitutionRule = fontSettings.SubstitutionSettings.TableSubstitution;

            // If "UnknownFont1" font family is not available then substitute it by "Comic Sans MS".
            substitutionRule.AddSubstitutes("UnknownFont1", new string[] { "Comic Sans MS" });
            LoadOptions lo = new LoadOptions();

            lo.FontSettings = fontSettings;
            Document doc = new Document(dataDir + "myfile.html", lo);

            // ExEnd:FontSettingsWithLoadOptions
            Console.WriteLine("\nFile created successfully.\nFile saved at " + dataDir);
        }