Çalışma Kitabı Rendeleme için Bireysel veya Özel Font Kümesini Belirtin
Olası Kullanım Senaryoları
Genellikle, tüm çalışma kitapları için font dizinini veya font listesini belirtirsiniz, ancak bazen, çalışma kitaplarınız için bireysel veya özel bir font kümesini belirtmeniz gerekir. Aspose.Cells, çalışma kitabınız için bireysel veya özel bir font kümesini belirtmek için kullanılabilecek IndividualFontConfigs sınıfını sağlar.
Çalışma Kitabı Rendeleme İçin Bireysel veya Özel Font Kümesini Belirtin
Aşağıdaki örnek kod, IndividualFontConfigs sınıfını kullanarak belirtilen bireysel veya özel fontları olan bir örnek Excel dosyasını yükler. Ayrıca kod içinde kullanılan örnek fontu ve onunla oluşturulan çıkış PDF‘i de görebilirsiniz. Aşağıdaki ekran görüntüsü, font başarıyla bulunursa çıktı PDF’in nasıl göründüğünü göstermektedir.
Örnek Kod
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Path of your custom font directory. | |
string customFontsDir = "C:\\TempDir\\CustomFonts"; | |
// Specify individual font configs custom font directory. | |
IndividualFontConfigs fontConfigs = new IndividualFontConfigs(); | |
// If you comment this line or if custom font directory is wrong or | |
// if it does not contain required font then output pdf will not be rendered correctly. | |
fontConfigs.SetFontFolder(customFontsDir, false); | |
// Specify load options with font configs. | |
LoadOptions opts = new LoadOptions(LoadFormat.Xlsx); | |
opts.FontConfigs = fontConfigs; | |
// Load the sample Excel file with individual font configs. | |
Workbook wb = new Workbook("sampleSpecifyIndividualOrPrivateSetOfFontsForWorkbookRendering.xlsx", opts); | |
// Save to PDF format. | |
wb.Save("outputSpecifyIndividualOrPrivateSetOfFontsForWorkbookRendering.pdf", SaveFormat.Pdf); |