Why to Convert JSON to PPSX?
JSON (JavaScript Object Notation) is a lightweight data-interchange format that is used to store and exchange data. It is a text-based format that is easy for humans to read and write, and easy for machines to parse and generate. PPSX (PowerPoint Open XML Slide Show) is a presentation format developed by Microsoft. It is used to store slides in a presentation created with Microsoft PowerPoint. It is a compressed version of the PPTX format and is used to store slideshows.
Converting JSON to PPSX is beneficial for many reasons. Firstly, it allows users to view the data in a more organized and visually appealing way. Secondly, it allows users to easily share the data with others. Lastly, it allows users to make changes to the data quickly and easily.
How Aspose.Total Helps for JSON to PPSX Conversion?
Aspose.Total for Android via Java is a comprehensive suite of APIs that enables developers to create, manipulate, and convert various file formats. It includes two APIs, Aspose.Cells for Android via Java and Aspose.Slides for Android via Java, which can be used to convert JSON to PPSX.
The first step in the process is to use Aspose.Cells for Android via Java to parse JSON to PPTX. This API provides a wide range of features that allow developers to easily create, manipulate, and convert various spreadsheet formats. It also provides support for parsing JSON to PPTX.
The second step is to use Aspose.Slides for Android via Java to convert PPTX to PPSX. This API provides a wide range of features that allow developers to easily create, manipulate, and convert various presentation formats. It also provides support for converting PPTX to PPSX.
In conclusion, Aspose.Total for Android via Java is a comprehensive suite of APIs that enables developers to easily convert JSON to PPSX. It includes two APIs, Aspose.Cells for Android via Java and Aspose.Slides for Android via Java, which can be used to parse JSON to PPTX and convert PPTX to PPSX respectively.
Convert JSON Format to PPSX in Android
- Create a new Workbook object and open JSON file
- Save JSON as PPTX using save method
- Load PPTX document by using Presentation class
- Save the document to PPSX format using save method
Get Started with Android via Java APIs
You can easily use Aspose.Total for Android via Java directly from Maven and install libraries in your app.
Alternatively, you can get a ZIP file from downloads .
// open JSON file using Workbook object | |
Workbook workbook = new Workbook("input.json"); | |
// save resultant file in JSON-TO-PPTX ormat | |
workbook.save("pptxOutput.pptx", SaveFormat.AUTO); | |
// instantiate a Presentation object that represents a PPTX file | |
Presentation presentation = new Presentation("pptxOutput.pptx"); | |
// supports PPT, POT, PPS, POTX, PPSX, PPTM, PPSM, POTM, ODP, and OTP file formats | |
// save the presentation as PPT | |
presentation.save("output.ppt", com.aspose.slides.SaveFormat.AUTO); |
Set Layout and Convert JSON Format to PPSX in Android Applications
Furthermore, the API allows you to parse JSON to PPSX with specified layout options. In order to specify the layout options, you can use JsonLayoutOptions class. It allows you to process an array as a table, ignore nulls, ignore array title, ignore object title, convert string to number or date, set date and number format, and set title style. All of these options allow you to present your data as per your needs. The following code snippet shows you how to set the layout options.
// create a blank Workbook object | |
Workbook workbook = new Workbook("input.json"); | |
// access default empty worksheet | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// read JSON file | |
String jsonInput = new String(Files.readAllBytes("SampleJson.json")); | |
// set JsonLayoutOptions for formatting | |
JsonLayoutOptions layoutOptions = new JsonLayoutOptions(); | |
layoutOptions.setArrayAsTable(true); | |
layoutOptionssetConvertNumericOrDate(true); | |
layoutOptionssetIgnoreArrayTitle(true); | |
layoutOptionssetIgnoreNull(true); | |
layoutOptionssetIgnoreObjectTitle(true); | |
// import JSON data to default worksheet starting at cell A1 | |
JsonUtility.importData(jsonInput, worksheet.getCells(), 0, 0, layoutOptions); | |
// save resultant file in JSON-TO-PPTX ormat | |
workbook.save("pptxOutput.pptx", SaveFormat.AUTO); | |
// instantiate a Presentation object that represents a PPTX file | |
Presentation presentation = new Presentation("pptxOutput.pptx"); | |
// supports PPT, POT, PPS, POTX, PPSX, PPTM, PPSM, POTM, ODP, and OTP file formats | |
// save the presentation as PPT | |
presentation.save("output.ppt", com.aspose.slides.SaveFormat.AUTO); |
Convert JSON Format to PPSX with Watermark in Android Apps
Using the API, you can also convert JSON to PPSX with watermark. In order to add a watermark to your PPSX document, you can first parse JSON to PPTX and add a watermark to it. In order to add a watermark, load the newly created PPTX file using the Presentation class, loop through all slides, add text using addTextFrame, set all the relevant options like color, fillType and more and can save the document to PPSX.
// open JSON file using Workbook object | |
Workbook workbook = new Workbook("input.json"); | |
// save resultant file in JSON-TO-PPTX ormat | |
workbook.save("pptxOutput.pptx", SaveFormat.AUTO); | |
// instantiate a Presentation object that represents a PPTX file | |
Presentation presentation = new Presentation("pptxOutput.pptx"); | |
for(ISlide slide:pres.getSlides()){ | |
IAutoShape ashp = slide.getShapes() | |
.addAutoShape(ShapeType.Rectangle,50, 50, 500, 500); | |
ashp.addTextFrame("Watermark Text"); | |
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions() | |
.get_Item(0).getPortionFormat().getFillFormat() | |
.setFillType(FillType.Solid); | |
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions() | |
.get_Item(0).getPortionFormat().getFillFormat() | |
.getSolidFillColor().setColor(Color.GRAY); | |
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions() | |
.get_Item(0).getPortionFormat().setFontHeight(25); | |
// Change the line color of the rectangle to White | |
ashp.getShapeStyle().getLineColor().setColor(Color.WHITE); | |
ashp.getShapeStyle().setLineStyleIndex(LineStyle.ThinThin); | |
// Remove any fill formatting in the shape | |
ashp.getFillFormat().setFillType(FillType.NoFill); | |
ashp.setRotation(-45); | |
ashp.getAutoShapeLock().setSelectLocked(true); | |
ashp.getAutoShapeLock().setSizeLocked(true); | |
ashp.getAutoShapeLock().setTextLocked(true); | |
ashp.getAutoShapeLock().setPositionLocked(true); | |
ashp.getAutoShapeLock().setGroupingLocked(true); | |
} | |
// supports PPT, POT, PPS, POTX, PPSX, PPTM, PPSM, POTM, ODP, and OTP file formats | |
// save the presentation as PPT | |
presentation.save("output.ppt", com.aspose.slides.SaveFormat.AUTO); |