الحصول على استدعاءات تحذيرية لاستبدال الخطوط في Aspose.Slides
Contents
[
Hide
]
تتيح لك Aspose.Slides لـ PHP عبر Java الحصول على استدعاءات تحذيرية لاستبدال الخطوط في حالة عدم توفر الخط المستخدم على الجهاز أثناء عملية الرسم. تعتبر استدعاءات التحذير مفيدة في تصحيح مشاكل الخطوط المفقودة أو غير المتاحة أثناء عملية الرسم.
تقدم Aspose.Slides لـ PHP عبر 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; | |
} | |
} |