Why to Convert XSLFO to OTP?
XSLFO (XSL Formatting Objects) is a markup language for XML document formatting. It is used to define the layout of a document, such as page size, margins, fonts, and other formatting information. OTP (OpenType PostScript) is a font format developed by Adobe and Microsoft. It is a cross-platform font format that supports both PostScript and TrueType outlines. OTP is widely used in the printing industry, and is the preferred format for many professional typesetting applications.
Converting XSLFO to OTP is necessary for applications that require high-quality typesetting and printing. It allows users to create documents with precise layout and formatting, and ensures that the document will look the same on any platform.
How Aspose.Total Helps for XSLFO to OTP Conversion
Aspose.Total for Android via Java is a comprehensive suite of APIs that enables developers to create, edit, and convert documents, spreadsheets, and presentations. It includes two APIs that can be used to convert XSLFO to OTP: Aspose.PDF for Android via Java and Aspose.Slides for Android via Java.
Using Aspose.PDF for Android via Java, developers can export XSLFO to PPTX. Then, using Aspose.Slides for Android via Java, they can convert PPTX to OTP. This two-step process makes it easy to integrate XSLFO to OTP conversion into Android applications. Aspose.Total for Android via Java also includes a number of other APIs that can be used to create, edit, and convert documents, spreadsheets, and presentations.
Android API to Export XSLFO to OTP
- Open XSLFO file using Document class
- Convert XSLFO to PPTX by using save method
- Load PPTX document by using Presentation class
- Save the document to OTP format using
save
method and set
Otp
as SaveFormat
Get Started with Java File Format APIs
You can easily use Aspose.Total for Android via Java directly from Maven and install Aspose.PDF for Android via Java and Aspose.Slides for Android via Java in your applications.
Alternatively, you can get a ZIP file from downloads .
// 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 Otp format
presentation.save("output.otp", SaveFormat.Otp);
Open Password Protected XSLFO File in Android Apps
While loading XSLFO file format, your document might be password protected. Aspose.PDF for Android via Java allows you open encrypted documents as well. In order to open the encrypted file, you can initialize new instance of the Document class and pass filename and password as arguments.
// open XSLFO document
Document doc = new Document("input.xslfo", "Your@Password");
// save XSLFO as PPTX format
document.save("PptxOutput.pptx", SaveFormat.Pptx);
Create Thumbnail Image of OTP File in Android Applications
After converting XSLFO to OTP, you can also create thumbnail images of your output document. By using rich in feature Aspose.Slides for Android via Java you can generate thumbnail images of the slides by creating and instance of the Presentation class. After that, you can obtain the reference of any desired slide by using its ID or index and get the thumbnail image of the referenced slide on a specified scale.
// instantiate a Presentation object that represents a OTP file
Presentation presentation = new Presentation("output.otp");
// access the first slide
ISlide sld = pres.getSlides().get_Item(0);
// create a full scale image
BufferedImage image = sld.getThumbnail(1f, 1f);
// save the image to disk in PNG format
ImageIO.write(image, "PNG", new java.io.File("Thumbnail_out.png"));