Çalışma Kitabı Rendeleme için Bireysel veya Özel Font Kümesini Belirtin
Olası Kullanım Senaryoları
Genellikle, tüm çalışbooklar için font dizinini veya font listesini belirtirsiniz, ancak bazen çalışbooklarınız için bireysel veya özel bir font kümesi belirtmeniz gerekebilir. Aspose.Cells, çalışbooklarınız için bireysel veya özel bir font kümesini belirlemek 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 çalışbookunun bireysel veya özel font kümesini yükler. Lütfen kodun içinde kullanılan örnek Excel dosyasını ve kod içinde kullanılan örnek fontu ve bunun tarafından oluşturulan çıktı PDF’ini inceleyin. Aşağıdaki ekran görüntüsü, font başarıyla bulunduğunda çı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-Java | |
// 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.setFontConfigs(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); |