باستخدام Aspose.Total for Java يمكنك بسهولة تحويل XSLFO إلى XAML داخل أي تطبيق Java J2SE و J2EE و J2ME. أولاً ، باستخدام Aspose.PDF for Java ، يمكنك تصدير XSLFO إلى PPTX. بعد ذلك ، باستخدام Aspose.Slides for Java PowerPoint Processing API ، يمكنك تحويل PPTX إلى XAML.
Java API لتحويل XSLFO إلى XAML
- افتح ملف XSLFO باستخدام فئة Document
- تحويل XSLFO إلى PPTX باستخدام طريقة Save
- قم بتحميل مستند PPTX باستخدام فئة Presentation
- احفظ المستند بتنسيق XAML باستخدام طريقة save واضبط `` Xaml` كـ SaveFormat
متطلبات التحويل
يمكنك بسهولة استخدام Aspose.Total for Java مباشرة من مشروع قائم على Maven وتشمل Aspose.PDF for Java و Aspose.Slides for Java في ملف pom.xml الخاص بك.
بدلاً من ذلك ، يمكنك الحصول على ملف ZIP من التنزيلات .
// load XSLFO file with an instance of Document class
Document document = new Document("template.xslfo");
// save XSLFO as PPTX format
document.save("PptxOutput.pptx", SaveFormat.Pptx);
// instantiate a Presentation object that represents a PPTX file
Presentation presentation = new Presentation("PptxOutput.pptx");
// save the presentation as Xaml format
presentation.save("output.xaml", SaveFormat.Xaml);
متطلبات التحويل
أثناء تحميل تنسيق ملف XSLFO ، قد يكون المستند محميًا بكلمة مرور. يسمح لك Aspose.PDF for Java بفتح المستندات المشفرة أيضًا. لفتح الملف المشفر ، يمكنك تهيئة مثيل جديد من Document فئة وتمرير اسم الملف وكلمة المرور كوسائط.
// open XSLFO document
Document doc = new Document("input.xslfo", "Your@Password");
// save XSLFO as PPTX format
document.save("PptxOutput.pptx", SaveFormat.Pptx);
افتح ملف XSLFO المشفر عبر Java
بعد تحويل XSLFO إلى XAML ، يمكنك أيضًا إضافة نوع عرض محدد مسبقًا لعرضك التقديمي. Aspose.Slides for Java يوفر وسيلة لتعيين نوع العرض للعرض التقديمي الذي تم إنشاؤه عند فتحه في PowerPoint من خلال ViewProperties فئة. تُستخدم خاصية setLastView ViewType لتعيين نوع العرض باستخدام العداد.
// instantiate a Presentation object that represents a PPTX file
Presentation presentation = new Presentation("PptxOutput.pptx");
// set view type
presentation.getViewProperties().setLastView((byte) ViewType.SlideMasterView);
// save the presentation as Xaml format
presentation.save("output.xaml", SaveFormat.Xaml);