الحصول على ردود تحذيرية لاستبدال الخطوط في Aspose.Slides
Contents
[
Hide
]
تتيح Aspose.Slides لـ Java الحصول على ردود تحذيرية لاستبدال الخطوط في حال عدم توفر الخط المستخدم على الجهاز أثناء عملية العرض. تعتبر ردود التحذير مفيدة في تصحيح مشاكل الخطوط المفقودة أو غير المتاحة أثناء عملية العرض.
توفر Aspose.Slides لـ Java طرق API بسيطة لاستقبال ردود التحذير أثناء عملية العرض. اتبع الخطوات أدناه لتكوين ردود التحذير:
- أنشئ فئة ردود مخصصة لاستقبال الردود.
- قم بإعداد ردود التحذير باستخدام فئة LoadOptions
- قم بتحميل ملف العرض الذي يستخدم خطًا غير متوفر على جهاز الهدف الخاص بك.
- قم بإنشاء صورة مصغرة للشريحة لرؤية التأثير.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Setting Warning Callbacks | |
LoadOptions lo = new LoadOptions(); | |
lo.setWarningCallback(new HandleFontsWarnings()); | |
//Instantiate the presentation | |
Presentation presentation = new Presentation("Test.ppt", lo); | |
//Generating slide thumbnail | |
for(ISlide slide : presentation.getSlides()){ | |
BufferedImage image = slide.getThumbnail(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HandleFontsWarnings implements IWarningCallback | |
{ | |
public int warning(IWarningInfo warning) | |
{ | |
System.out.println(warning.getWarningType()); // 1 - WarningType.DataLoss | |
System.out.println(warning.getDescription()); // "Font will be substituted from X to Y" | |
return ReturnAction.Continue; | |
} | |
} |