diff --git a/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.py new file mode 100644 index 00000000..889ccb2b --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.py @@ -0,0 +1,47 @@ +__author__ = 'fahadadeel' +import jpype + +class HelloWorld: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.Color=jpype.JPackage("java.awt.Color") + + def main(self): + + # Instantiate Presentation + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shape_type = self.ShapeType + slide_shapes = slide.getShapes() + ashp = slide_shapes().addAutoShape(shape_type.Rectangle, 150, 75, 150, 50) + + # Add ITextFrame to the Rectangle + ashp.addTextFrame("Hello World") + + # Change the text color to Black (which is White by default) + fill_type = self.FillType() + color = self.Color() + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().setFillType(fill_type.Solid) + ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Change the line color of the rectangle to White + ashp.getShapeStyle().getLineColor().setColor(color.WHITE) + + # Remove any fill formatting in the shape + ashp.getFillFormat().setFillType(fill_type.NoFill) + + # Save the presentation to disk + save_format = self.SaveFormat + pres.save(self.dataDir + "HelloWorld.pptx", save_format.Pptx) + + print "Document has been saved, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.pyc new file mode 100644 index 00000000..061b226e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/IntroductionToPresentation/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/README.md b/Plugins/Aspose-Slides-Java-for-Python/README.md new file mode 100644 index 00000000..6ae7bee5 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/README.md @@ -0,0 +1,22 @@ +## Aspose.Slides Java for Python + +Aspose.Slides Java for Python is a project that demonstrates / provides the Aspose.Slides for Java API usage examples in Python. + +## Download + +* To download Aspose.Slides for Java API to be used with these examples, Please navigate to [Aspose.Slides for Java](http://www.aspose.com/community/files/72/java-components/aspose.slides-for-java/) +* Place downloaded jar file into "lib" directory. + +## Documentation + +For most complete documentation of the project, check [Aspose.Slides Java For Python confluence wiki](http://www.aspose.com/docs/display/slidesjava/Aspose.Slides+Java+for+Python). + +## Download Latest Versions? + +* [Latest Releases on Codeplex](http://asposeslidesjavapython.codeplex.com/releasesce) + +## Clone Plugin SourceCodes? + +This project is also hosted and maintained at CodePlex. To clone navigate to: + +* [Aspose.Slides Java for Python on CodePlex - click here](https://asposeslidesjavapython.codeplex.com/SourceControl/latest) diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.py new file mode 100644 index 00000000..9c331034 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.py @@ -0,0 +1,993 @@ +__author__ = 'fahadadeel' +import jpype + +class CreateChart: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.MarkerStyleType=jpype.JClass("com.aspose.slides.MarkerStyleType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Creating Normal Charts + self.create_normal_chart() + + # Creating Scattered Chart with multiple series and different series markers + self.create_scatter_chart() + + def create_normal_chart(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + chartTye = self.ChartType + chart = sld.getShapes().addChart(chartTye.ClusteredColumn, 0, 0, 500, 500) + + # Setting chart Title + # chart.ChartTitle.TextFrameForOverriding.Text = "Sample Title" + chart.getChartTitle().addTextFrameForOverriding("Sample Title") + nullableBool = self.NullableBool() + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) + chart.getChartTitle().setHeight (20) + chart.hasTitle(True) + + # Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(True) + + # Setting the index of chart data sheet + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + s = chart.getChartData().getSeries().size() + s = chart.getChartData().getCategories().size() + + # Adding self.series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType()) + + # Adding self.categories + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1")) + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2")) + chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3")) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)) + + # Setting fill color for series + fillType=self.FillType() + color=self.Color() + series.getFormat().getFill().setFillType(fillType.Solid) + series.getFormat().getFill().getSolidFillColor().setColor(color.RED) + + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60)) + + # Setting fill color for series + fillType=self.FillType() + color=self.Color() + series.getFormat().getFill().setFillType(fillType.Solid) + series.getFormat().getFill().getSolidFillColor().setColor(color.GREEN) + + # create custom labels for each of categories for self.series + # first label will be show Category name + lbl = series.getDataPoints().get_Item(0).getLabel() + lbl.getDataLabelFormat().setShowCategoryName(True) + + lbl = series.getDataPoints().get_Item(1).getLabel() + lbl.getDataLabelFormat().setShowSeriesName(True) + + # Show value for third label + lbl = series.getDataPoints().get_Item(2).getLabel() + lbl.getDataLabelFormat().setShowValue(True) + lbl.getDataLabelFormat().setShowSeriesName(True) + lbl.getDataLabelFormat().setSeparator ("/") + + # Save presentation with chart + + saveFormat = self.SaveFormat + pres.save(self.dataDir + "NormalChart.pptx", saveFormat.Pptx) + + print "Created normal chart, please check the output file." . PHP_EOL + + def create_scatter_chart(self): + pres = self.Presentation + + slide = pres.getSlides().get_Item(0) + + chartType=self.ChartType() + + # Creating the default chart + chart = slide.getShapes().addChart(chartType.ScatterWithSmoothLines, 0, 0, 400, 400) + + # Getting the default chart data worksheet index + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete demo series + chart.getChartData().getSeries().clear() + + # Add self.series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 1, 3, "Series 2"), chart.getType()) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Add self.point (1:3) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 1), fact.getCell(defaultWorksheetIndex, 2, 2, 3)) + + # Add self.point (2:10) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 2), fact.getCell(defaultWorksheetIndex, 3, 2, 10)) + + # Edit the type of series + chartType=self.ChartType() + series.setType(chartType.ScatterWithStraightLinesAndMarkers) + + # Changing the chart series marker + + markerStyleType=self.MarkerStyleType() + series.getMarker().setSize(10) + series.getMarker().setSymbol(markerStyleType.Star) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Add self.point (5:2) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 5), fact.getCell(defaultWorksheetIndex, 2, 4, 2)) + + # Add self.point (3:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 3), fact.getCell(defaultWorksheetIndex, 3, 4, 1)) + + # Add self.point (2:2) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 4, 3, 2), fact.getCell(defaultWorksheetIndex, 4, 4, 2)) + + # Add self.point (5:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 5, 3, 5), fact.getCell(defaultWorksheetIndex, 5, 4, 1)) + + # Changing the chart series marker + + markerStyleType1=self.MarkerStyleType() + + series.getMarker().setSize(10) + series.getMarker().setSymbol(markerStyleType1.Circle) + + save_format = self.SaveFormat + pres.save(self.dataDir + "AsposeScatterChart.pptx", save_format.Pptx) + + print "Created scatter chart, please check the output file." + + +class ChartLegend: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.MarkerStyleType=jpype.JClass("com.aspose.slides.MarkerStyleType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.Color=jpype.JClass("java.awt.Color") + + + def main(self): + + # Setting Custom Location and Size for Chart legend + self.set_location_and_size() + + def set_location_and_size(self): + + # Creating empty presentation + pres = self.Presentation() + + # Get reference of the slide + slide = pres.getSlides().get_Item(0) + + # Add a clustered column chart on the slide + + chartType=self.ChartType + + chart = slide.getShapes.addChart(chartType.ClusteredColumn, 50, 50, 500, 500) + + # Set Legend Properties + chart.getLegend().setX(50 / chart.getWidth()) + chart.getLegend().setY (50 / chart.getHeight()) + chart.getLegend().setWidth(100 / chart.getWidth()) + chart.getLegend().setHeight(100 / chart.getHeight()) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Legend.pptx", save_format.Pptx) + + print "Set custom location and size of chart legend, please check the output file." + + +class ChartProperties: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Setting the RotationX, RotationY and DepthPercents properties of 3D Chart. + self.set_rotation_and_depth() + + # Setting the GapWidth property of Chart Series + self.set_gapwidth() + + + def set_rotation_and_depth(self): + + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + charType=self.ChartType + chart = sld.getShapes().addChart(charType.StackedColumn3D, 0, 0, 500, 500) + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + + # Adding self.series + chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(0, 0, 2, "Series 2"), chart.getType()) + + # Adding self.categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "Caetegoty 1")) + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "Caetegoty 2")) + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "Caetegoty 3")) + + # Set Rotation3D properties + chart.getRotation3D().setRightAngleAxes(True) + chart.getRotation3D().setRotationX(40) + chart.getRotation3D().setRotationY(270) + chart.getRotation3D().setDepthPercents(150) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 1, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 1, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 1, 30)) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 2, 30)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 2, 10)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 2, 60)) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "3Drotation.pptx", save_format.Pptx) + + print "Done with rotation, please check the output file." + + + def set_gapwidth(self): + + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + charType=self.ChartType() + chart = sld.getShapes().addChart(charType.StackedColumn3D, 0, 0, 500, 500) + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + + # Adding self.series + chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) + chart.getChartData().getSeries().add(fact.getCell(0, 0, 2, "Series 2"), chart.getType()) + + # Adding self.categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "Caetegoty 1")) + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "Caetegoty 2")) + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "Caetegoty 3")) + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 1, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 1, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 1, 30)) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 1, 2, 30)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 2, 2, 10)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, 3, 2, 60)) + + # Set GapWidth value + series.getParentSeriesGroup().setGapWidth(75) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "SetGapWidth.pptx", save_format.Pptx) + + print "Set Gapwidth property of chart series, please check the output file." + + +class ChartSeries: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Adding Chart Series Overlap for Charts + self.add_overlap_for_chart() + + def add_overlap_for_chart(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Adding chart + chartType = self.ChartType + + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 50, 50, 600, 400, True) + + series = chart.getChartData().getSeries() + if (series.get_Item(0).getOverlap() == 0): + # Setting series overlap + series . get_Item(0) . getParentSeriesGroup().setOverlap(-30) + + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Overlap.pptx", save_format.Pptx) + + print "Added chart series overlap for charts, please check the output file." + +class ChartTrendLines: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TrendlineType=jpype.JClass("com.aspose.slides.TrendlineType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + + + def main(self): + + # Creating empty presentation + pres =self.Presentation() + + # Creating a clustered column chart + chartType=self.ChartType + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 400) + + # Adding ponential trend line for chart series 1 + trendlineType=self.TrendlineType() + tredLinep = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(trendlineType.Exponential) + tredLinep.setDisplayEquation(False) + tredLinep.setDisplayRSquaredValue(False) + + # Adding Linear trend line for chart series 1 + fillType=self.FillType() + color=self.Color() + + tredLineLin = chart.getChartData().getSeries().get_Item(0).getTrendLines().add(trendlineType.Linear) + tredLineLin.setTrendlineType(trendlineType.Linear) + tredLineLin.getFormat().getLine().getFillFormat().setFillType(fillType.Solid) + tredLineLin.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) + + + # Adding Logarithmic trend line for chart series 2 + tredLineLog = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.Logarithmic) + tredLineLog.setTrendlineType(trendlineType.Logarithmic) + tredLineLog.addTextFrameForOverriding("self.log trend line") + + # Adding MovingAverage trend line for chart series 2 + tredLineMovAvg = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.MovingAverage) + tredLineMovAvg.setTrendlineType(trendlineType.MovingAverage) + tredLineMovAvg.setPeriod(3) + tredLineMovAvg.setTrendlineName("self.TrendLine Name") + + # Adding Polynomial trend line for chart series 3 + tredLinePol = chart.getChartData().getSeries().get_Item(2).getTrendLines().add(trendlineType.Polynomial) + tredLinePol.setTrendlineType(trendlineType.Polynomial) + tredLinePol.setForward(1) + tredLinePol.setOrder(3) + + # Adding Power trend line for chart series 3 + tredLinePower = chart.getChartData().getSeries().get_Item(1).getTrendLines().add(trendlineType.Power) + tredLinePower.setTrendlineType(trendlineType.Power) + tredLinePower.setBackward(1) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "ChartTrendLines.pptx", save_format.Pptx) + + print "Done with chart trend lines, please check the output file." + +class ErrorBars: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ErrorBarValueType=jpype.JClass("com.aspose.slides.ErrorBarValueType") + self.DataSourceType=jpype.JClass("com.aspose.slides.DataSourceType") + self.ErrorBarType=jpype.JClass("com.aspose.slides.ErrorBarType") + + + def main(self): + # Adding Fixed Error Bar Value for Chart + self.add_fixed_error_bar_value() + + # Adding Custom Error Bar Value for Chart + self.add_custom_error_bar_value() + + def add_fixed_error_bar_value(self): + + pres = self.Presentation() + + # Creating a bubble chart + chartType=self.ChartType + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.Bubble, 50, 50, 400, 300, True) + + # Adding Error bars and setting its format + error_bar_x = chart.getChartData().getSeries().get_Item(0).getErrorBarsXFormat() + error_bar_y = chart.getChartData().getSeries().get_Item(0).getErrorBarsYFormat() + + + + #error_bar_x.isVisible(True) + #error_bar_y.isVisible(True) + + errorBarValueType = self.ErrorBarValueType() + errorBarType = self.ErrorBarType() + + error_bar_x.setValueType(errorBarValueType.Fixed) + + error_bar_x.setValue(0.1) + + error_bar_y.setValueType(errorBarValueType.Percentage) + error_bar_y.setValue(5) + error_bar_x.setType(errorBarType.Plus) + error_bar_y.getFormat().getLine().setWidth(2.0) + #error_bar_x.hasEndCap(True) + + # Save presentation with chart + save_format = self.SaveFormat + pres.save(self.dataDir + "ErrorBar.pptx", save_format.Pptx) + + print "Added fixed error bar value for chart, please check the output file." + + def add_custom_error_bar_value(self): + + pres = self.Presentation() + + slide = pres.getSlides().get_Item(0) + + # Creating a bubble chart + chartType = self.ChartType() + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.Bubble, 50, 50, 400, 300, True) + + # Adding custom Error bars and setting its format + error_bar_value_type = self.ErrorBarValueType() + series = chart.getChartData().getSeries().get_Item(0) + error_bar_x = series.getErrorBarsXFormat() + error_bar_y = series.getErrorBarsYFormat() + + #error_bar_x.isVisible(True) + #error_bar_y.isVisible(True) + + error_bar_x.setValueType(error_bar_value_type.Custom) + error_bar_y.setValueType(error_bar_value_type.Custom) + + #Accessing chart series data point and setting error bars values for individual point + data_source_type = self.DataSourceType() + points = series.getDataPoints() + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXPlusValues(data_source_type.DoubleLiterals) + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForXMinusValues(data_source_type.DoubleLiterals) + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYPlusValues(data_source_type.DoubleLiterals) + points.getDataSourceTypeForErrorBarsCustomValues().setDataSourceTypeForYMinusValues(data_source_type.DoubleLiterals) + + # Setting error bars for chart series points + i = 0 + while (i < points.size()): + points.get_Item(i).getErrorBarsCustomValues().getXMinus().setAsLiteralDouble(i + 1) + points.get_Item(i).getErrorBarsCustomValues().getXPlus().setAsLiteralDouble(i + 1) + points.get_Item(i).getErrorBarsCustomValues().getYMinus().setAsLiteralDouble(i + 1) + points.get_Item(i).getErrorBarsCustomValues().getYPlus().setAsLiteralDouble(i + 1) + i+=1 + + + save_format = self.SaveFormat + pres.save(self.dataDir + "ErrorBarsCustomValues.pptx", save_format.Pptx) + + print "Added custom error bars values for chart, please check the output file." + +class ExistingChart: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ErrorBarValueType=jpype.JClass("com.aspose.slides.ErrorBarValueType") + self.DataSourceType=jpype.JClass("com.aspose.slides.DataSourceType") + self.ErrorBarType=jpype.JClass("com.aspose.slides.ErrorBarType") + + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + "AsposeChart.pptx") + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + chart = sld.getShapes().get_Item(0) + + # Setting the index of chart data sheet + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Changing chart Category Name + fact.getCell(defaultWorksheetIndex, 1, 0, "Modified Category 1") + fact.getCell(defaultWorksheetIndex, 2, 0, "Modified Category 2") + + + # Take first chart series + series = chart.getChartData().getSeries().get_Item(0) + + # Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 1, "New_Series1") # modifying series name + series.getDataPoints().get_Item(0).getValue().setData(90) + series.getDataPoints().get_Item(1).getValue().setData(123) + series.getDataPoints().get_Item(2).getValue().setData(44) + + # Take Second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Now updating series data + fact.getCell(defaultWorksheetIndex, 0, 2, "New_Series2") #modifying series name + series.getDataPoints().get_Item(0).getValue().setData(23) + series.getDataPoints().get_Item(1).getValue().setData(67) + series.getDataPoints().get_Item(2).getValue().setData(99) + + + # Now, Adding a self.series + chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 3, "Series 3"), chart.getType()) + + # Take 3rd chart series + series = chart.getChartData().getSeries().get_Item(2) + + # Now populating series data + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 3, 20)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 50)) + series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 30)) + + chartType=self.ChartType + chart.setType(chartType.ClusteredCylinder) + + + # Saving the presentation to HTML format + save_format = self.SaveFormat + pres.save(self.dataDir + "AsposeChartModified.pptx", save_format.Pptx) + + print "Updated chart, please check the output file." + +class FormattingChartEntities: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.LineDashStyle=jpype.JClass("com.aspose.slides.LineDashStyle") + self.DisplayUnitType=jpype.JClass("com.aspose.slides.DisplayUnitType") + self.FontData=jpype.JClass("com.aspose.slides.FontData") + self.PresetColor=jpype.JClass("com.aspose.slides.PresetColor") + self.TickLabelPositionType=jpype.JClass("com.aspose.slides.TickLabelPositionType") + self.LineStyle=jpype.JClass("com.aspose.slides.LineStyle") + + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Accessing the first slide + slide = pres.getSlides().get_Item(0) + + # Adding the sample chart + chartType=self.ChartType + chart = slide.getShapes().addChart(chartType.LineWithMarkers, 50, 50, 500, 400) + + # Setting Chart Titile + chart.hasTitle(True) + chart.getChartTitle().addTextFrameForOverriding("") + chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + chartTitle.setText("Sample Chart") + + fillType=self.FillType() + color=self.Color() + nullableBool=self.NullableBool() + lineDashStyle=self.LineDashStyle() + + chartTitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + chartTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) + chartTitle.getPortionFormat().setFontHeight (20) + chartTitle.getPortionFormat().setFontBold(nullableBool.True) + chartTitle.getPortionFormat().setFontItalic(nullableBool.True) + + # Setting Major grid lines format for value axis + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.BLUE) + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setWidth(5) + chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().setDashStyle(lineDashStyle.DashDot) + + # Setting Minor grid lines format for value axis + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) + chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().setWidth(3) + + # Setting value axis number format + + displayUnitType=self.DisplayUnitType() + chart.getAxes().getVerticalAxis().isNumberFormatLinkedToSource(False) + chart.getAxes().getVerticalAxis().setDisplayUnit(displayUnitType.Thousands) + chart.getAxes().getVerticalAxis().setNumberFormat("0.0%") + + # Setting chart maximum, minimum values + chart.getAxes().getVerticalAxis().isAutomaticMajorUnit(False) + chart.getAxes().getVerticalAxis().isAutomaticMaxValue(False) + chart.getAxes().getVerticalAxis().isAutomaticMinorUnit(False) + chart.getAxes().getVerticalAxis().isAutomaticMinValue(False) + + chart.getAxes().getVerticalAxis().setMaxValue(15) + chart.getAxes().getVerticalAxis().setMinValue(-2) + chart.getAxes().getVerticalAxis().setMinorUnit(0.5) + chart.getAxes().getVerticalAxis().setMajorUnit(2.0) + + # Setting Value Axis Text Properties + + fontData=self.FontData() + presetColor=self.PresetColor() + + txtVal = chart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat() + txtVal.setFontBold(nullableBool.True) + txtVal.setFontHeight(16) + txtVal.setFontItalic(nullableBool.True) + txtVal.getFillFormat().setFillType(fillType.Solid) + txtVal.getFillFormat().getSolidFillColor().setColor(self.Color(presetColor.DarkGreen)) + txtVal.setLatinFont(self.FontData("Times self.Roman")) + + # Setting value axis title + chart.getAxes().getVerticalAxis().hasTitle(True) + chart.getAxes().getVerticalAxis().getTitle().addTextFrameForOverriding("") + valtitle = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + valtitle.setText("Primary Axis") + valtitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + valtitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) + valtitle.getPortionFormat().setFontHeight(20) + valtitle.getPortionFormat().setFontBold(nullableBool.True) + valtitle.getPortionFormat().setFontItalic(nullableBool.True) + + # Setting Major grid lines format for Category axis + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.GREEN) + chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().setWidth(5) + + # Setting Minor grid lines format for Category axis + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(fillType.Solid) + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.YELLOW) + chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().setWidth(3) + + #Setting Category Axis Text Properties + txtCat = chart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat() + txtCat.setFontBold(nullableBool.True) + txtCat.setFontHeight(16) + txtCat.setFontItalic(nullableBool.True) + txtCat.getFillFormat().setFillType(fillType.Solid) + txtCat.getFillFormat().getSolidFillColor().setColor(color.BLUE) + txtCat.setLatinFont(self.FontData("Arial")) + + # Setting Category Titile + chart.getAxes().getHorizontalAxis().hasTitle(True) + chart.getAxes().getHorizontalAxis().getTitle().addTextFrameForOverriding("") + + catTitle = chart.getAxes().getHorizontalAxis().getTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + catTitle.setText("Sample Category") + catTitle.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + catTitle.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GRAY) + catTitle.getPortionFormat().setFontHeight(20) + catTitle.getPortionFormat().setFontBold(nullableBool.True) + catTitle.getPortionFormat().setFontItalic(nullableBool.True) + + # Setting category axis lable position + tickLabelPositionType = self.TickLabelPositionType() + chart.getAxes().getHorizontalAxis().setTickLabelPosition(tickLabelPositionType.Low) + + # Setting category axis lable rotation angle + chart.getAxes().getHorizontalAxis().setTickLabelRotationAngle(45) + + # Setting Legends Text Properties + txtleg = chart.getLegend().getTextFormat().getPortionFormat() + txtleg.setFontBold(nullableBool.True) + txtleg.setFontHeight(16) + txtleg.setFontItalic(nullableBool.True) + txtleg.getFillFormat().setFillType(fillType.Solid) + txtleg.getFillFormat().getSolidFillColor().setColor(self.Color(presetColor.DarkRed)) + + # Set show chart legends without overlapping chart + chart.getLegend().setOverlay(True) + #chart.ChartData.Series[0].PlotOnSecondAxis=True + chart.getChartData().getSeries().get_Item(0).setPlotOnSecondAxis(True) + + # Setting secondary value axis + lineStyle = self.LineStyle() + chart.getAxes().getSecondaryVerticalAxis().isVisible(True) + chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setStyle(lineStyle.ThickBetweenThin) + chart.getAxes().getSecondaryVerticalAxis().getFormat().getLine().setWidth(20) + + # Setting secondary value axis Number format + chart.getAxes().getSecondaryVerticalAxis().isNumberFormatLinkedToSource(False) + displayUnitType=self.DisplayUnitType() + chart.getAxes().getSecondaryVerticalAxis().setDisplayUnit(displayUnitType.Hundreds) + chart.getAxes().getSecondaryVerticalAxis().setNumberFormat ("0.0%") + + # Setting chart maximum, minimum values + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMajorUnit(False) + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMaxValue(False) + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinorUnit(False) + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinValue(False) + + chart.getAxes().getSecondaryVerticalAxis().setMaxValue(20) + chart.getAxes().getSecondaryVerticalAxis().setMinValue(-5) + chart.getAxes().getSecondaryVerticalAxis().setMinorUnit(0.5) + chart.getAxes().getSecondaryVerticalAxis().setMajorUnit(2.0) + + + # Setting chart back wall color + chart.getBackWall().setThickness(1) + chart.getBackWall().getFormat().getFill().setFillType(fillType.Solid) + chart.getBackWall().getFormat().getFill().getSolidFillColor().setColor(color.ORANGE) + + chart.getFloor().getFormat().getFill().setFillType(fillType.Solid) + chart.getFloor().getFormat().getFill().getSolidFillColor().setColor(color.RED) + + # Setting Plot area color + chart.getPlotArea().getFormat().getFill().setFillType(fillType.Solid) + chart.getPlotArea().getFormat().getFill().getSolidFillColor().setColor(self.Color(presetColor.LightCyan)) + + # Save Presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "FormattedChart.pptx", save_format.Pptx) + + print "Formatted chart entities, please check the output file." + +class SetLabelDistance: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Adding a chart on slide + chartType=self.ChartType + ch = sld.getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 300) + + # Setting the position of label from axis + ch.getAxes().getHorizontalAxis().setLabelOffset(500) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Position.pptx", save_format.Pptx) + + print "Set label distance, please check the output file." + + +class SetPieChartColors: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ChartType=jpype.JClass("com.aspose.slides.ChartType") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.LineStyle=jpype.JClass("com.aspose.slides.LineStyle") + self.LineDashStyle=jpype.JClass("com.aspose.slides.LineDashStyle") + self.Color=jpype.JClass("java.awt.Color") + self.PresetColor=jpype.JClass("com.aspose.slides.PresetColor") + + def main(self): + + pres = self.Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + chart_type = self.ChartType + chart = sld.getShapes().addChart(chart_type.Pie, 100, 100, 400, 400) + + nullableBool=self.NullableBool() + + # Setting chart Title + chart.getChartTitle().addTextFrameForOverriding("Sample Title") + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) + chart.getChartTitle().setHeight(20) + chart.hasTitle(True) + + # Set first series to Show Values + chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(True) + + # Setting the index of chart data sheet + defaultWorksheetIndex = 0 + + # Getting the chart data worksheet + fact = chart.getChartData().getChartDataWorkbook() + + # Delete default generated series and categories + chart.getChartData().getSeries().clear() + chart.getChartData().getCategories().clear() + + # Adding self.categories + chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "First Qtr")) + chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "2nd Qtr")) + chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "3rd Qtr")) + + # Adding self.series + series = chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType()) + + # Now populating series data + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20)) + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50)) + series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30)) + + # Not working in self.version + # Adding self.points and setting sector color + chart.getChartData().getSeriesGroups().get_Item(0).isColorVaried(True) + + fill_type = self.FillType() + line_style = self.LineStyle() + color = self.Color() + line_dash_style = self.LineDashStyle() + preset_color = self.PresetColor() + + point = series.getDataPoints().get_Item(0) + point.getFormat().getFill().setFillType(fill_type.Solid) + point.getFormat().getFill().getSolidFillColor().setColor(color.CYAN) + + # Setting Sector border + point.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) + point.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.GRAY) + point.getFormat().getLine().setWidth(3.0) + point.getFormat().getLine().setStyle(line_style.ThinThick) + point.getFormat().getLine().setDashStyle(line_dash_style.DashDot) + + + point1 = series.getDataPoints().get_Item(1) + point1.getFormat().getFill().setFillType(fill_type.Solid) + point1.getFormat().getFill().getSolidFillColor().setColor(self.Color(preset_color.Brown)) + + # Setting Sector border + point1.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) + point1.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.BLUE) + point1.getFormat().getLine().setWidth(3.0) + point1.getFormat().getLine().setStyle(line_style.Single) + point1.getFormat().getLine().setDashStyle(line_dash_style.LargeDashDot) + + point2 = series.getDataPoints().get_Item(2) + point2.getFormat().getFill().setFillType(fill_type.Solid) + point2.getFormat().getFill().getSolidFillColor().setColor(self.Color(preset_color.Coral)) + + # Setting Sector border + point2.getFormat().getLine().getFillFormat().setFillType(fill_type.Solid) + point2.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(color.RED) + point2.getFormat().getLine().setWidth(2.0) + point2.getFormat().getLine().setStyle(line_style.ThinThin) + point2.getFormat().getLine().setDashStyle(line_dash_style.LargeDashDotDot) + + # Create custom labels for each of categories for self.series + lbl1 = series.getDataPoints().get_Item(0).getLabel() + + lbl1.getDataLabelFormat().setShowValue(True) + + lbl2 = series.getDataPoints().get_Item(1).getLabel() + lbl2.getDataLabelFormat().setShowValue (True) + lbl2.getDataLabelFormat().setShowLegendKey(True) + lbl2.getDataLabelFormat().setShowPercentage(True) + + lbl3 = series.getDataPoints().get_Item(2).getLabel() + lbl3.getDataLabelFormat().setShowSeriesName(True) + lbl3.getDataLabelFormat().setShowPercentage (True) + + # Showing Leader Lines for Chart + series.getLabels().getDefaultDataLabelFormat().setShowLeaderLines(True) + + # Setting Rotation Angle for Pie Chart Sectors + chart.getChartData().getSeriesGroups().get_Item(0).setFirstSliceAngle(180) + + # Save presentation with chart + save_format = self.SaveFormat + pres.save(self.dataDir + "AsposePieChart.pptx", save_format.Pptx) + + print "Set pie chart sector colors, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.pyc new file mode 100644 index 00000000..d5833ef1 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithCharts/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.py new file mode 100644 index 00000000..a350a6e9 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.py @@ -0,0 +1,385 @@ +__author__ = 'fahadadeel' +import jpype + +class ConvertingToHtml: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.HtmlOptions=jpype.JClass("com.aspose.slides.HtmlOptions") + self.HtmlFormatter=jpype.JClass("com.aspose.slides.HtmlFormatter") + + + def main(self): + + self.convert_to_html() + + + def convert_to_html(self): + + # Instantiate a Presentation object that represents a PPTX file + pres=self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + html_opt = self.HtmlOptions() + html_formatter = self.HtmlFormatter + html_opt.setHtmlFormatter(html_formatter.createDocumentFormatter("",False)) + + # Saving the presentation to HTML format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.html", save_format.Html, html_opt) + + print "Document has been converted, please check the output file." + +class ConvertingToNotes: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + # Converting Presentation to TIFF Notes + self.convert_to_tiff_notes() + + # Converting Presentation to TIFF Notes + self.convert_to_pdf_notes() + + def convert_to_tiff_notes(self): + + # Instantiate a Presentation object that represents a PPTX file + pres=self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Notes.tiff", save_format.TiffNotes) + + print "Document has been converted, please check the output file." + + + def convert_to_pdf_notes(self): + + # Instantiate a Presentation object that represents a PPTX file + pres = self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Notes.pdf", save_format.pdf) + + print "Document has been converted, please check the output file." + +class ConvertingToslides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate a Presentation object that represents a PPTX file + pres = self.presentation() + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to slides format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.slides", save_format.slides) + + print "Document has been converted, please check the output file." + +class ConvertingToTiff: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TiffOptions=jpype.JClass("com.aspose.slides.TiffOptions") + self.TiffCompressionTypes=jpype.JClass("com.aspose.slides.TiffCompressionTypes") + self.Dimension=jpype.JClass("java.awt.Dimension") + + def main(self): + + # Converting Presentation to TIFF with default size + self.convert_with_default_size() + + # Converting Presentation to TIFF with custom size + self.convert_with_custom_size() + + def convert_with_default_size(self): + + pres = self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to Tiff format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.tiff", save_format.Tiff) + + print "Document has been converted, please check the output file." + + def convert_with_custom_size(self): + + # Instantiate a Presentation object that represents a PPTX file + pres= self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Instantiate the TiffOptions class + opts = self.TiffOptions() + + # Setting compression type + tiff_compression_types = self.TiffCompressionTypes + opts.setCompressionType (tiff_compression_types.Default) + + #Setting image DPI + opts.setDpiX(200) + opts.setDpiY(100) + + # Set Image Size + opts.setImageSize(self.Dimension(1728, 1078)) + + # Save the presentation to TIFF with specified image size + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose-Custom-Size.tiff", save_format.Tiff,opts) + + print "Document has been converted, please check the output file." + + +class ConvertingToXps: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.XpsOptions=jpype.JClass("com.aspose.slides.XpsOptions") + + def main(self): + + # Converting Presentation to TIFF with default size + self.convert_with_default_size() + + # Converting Presentation to TIFF with custom size + self.convert_with_custom_size() + + def convert_with_default_size(self): + + # Instantiate a Presentation object that represents a PPTX file + pres=self.Presentation + pres = pres(self.dataDir + "Aspose.pptx") + + # Saving the presentation to XPS format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.xps", save_format.Xps) + + print "Document has been converted, please check the output file." + + def convert_with_custom_size(self): + + # Instantiate a Presentation object that represents a PPTX file + pres = self.Presentation(self.dataDir + "Aspose.pptx") + + # Instantiate the TiffOptions class + opts = self.XpsOptions() + + # Save MetaFiles as PNG + opts.SaveMetafilesAsPng = True + + # Save the presentation to TIFF with specified image size + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose-Custom-Size.xps", save_format.Xps, opts) + + print "Document has been converted, please check the output file." + + +class OdpToPptx: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + pres= self.Presentation + pres = pres(self.dataDir + "Source.odp") + + # Saving the PPTX presentation to PPTX format + save_format = self.SaveFormat + pres.save(self.dataDir + "Source.pptx", save_format.Pptx) + + print "Document has been converted, please check the output file." + +class PptToPptx: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate a Presentation object that represents a PPTX file + pres= self.Presentation + pres = pres(self.dataDir + "Presentation1.pptx") + + # Saving the PPTX presentation to PPTX format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.pptx", save_format.Pptx) + + print "Document has been converted, please check the output file." + +class Properties: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + self.get_properties() + + # Modifying Built-in Properties + self.update_properties() + + # Adding Custom Document Properties + self.add_custom_properties() + + # Removing Document Properties + self.remove_property() + + def get_properties(self): + + # Instantiate the Presentation class that represents the presentation + pres = self.Presentation + pres = pres(self.dataDir + "HelloWorld.pptx") + + # Create a reference to IDocumentProperties object associated with Presentation + dp = pres.getDocumentProperties() + + # Display the builtin properties + print "Category : " + dp.getCategory() + print "Current Status : " + dp.getContentStatus() + print "Creation Date : " + print dp.getCreatedTime() + print "Author : " + dp.getAuthor() + print "Description : " + dp.getComments() + print "KeyWords : " + dp.getKeywords() + print "Last Modified By : " + dp.getLastSavedBy() + print "Supervisor : " + dp.getManager() + print "Modified Date : " + print dp.getLastSavedTime() + #print "Presentation Format : " + dp.getPresentationFormat() + print "Last Print Date : " + print dp.getLastPrinted() + print "Is Shared between producers : " + print dp.getSharedDoc() + print "Subject : " + dp.getSubject() + print "Title : " + dp.getTitle() + + def update_properties(self): + + # Instantiate the Presentation class that represents the presentation + pres = self.Presentation(self.dataDir + "HelloWorld.pptx") + + # Create a reference to IDocumentProperties object associated with Presentation + dp = pres.getDocumentProperties() + + # Set the builtin properties + dp.setAuthor ("Aspose.Slides for Java") + dp.setTitle ("Modifying Presentation Properties") + dp.setSubject ( "Aspose Subject") + dp.setComments ( "Aspose Description") + dp.setManager ( "Aspose Manager") + + # Save your presentation to a file + save_format = self.SaveFormat + pres.save(self.dataDir + "DocProps.pptx", save_format.Pptx) + + print "Properties have been updated, Please check output file." + + def add_custom_properties(self): + + # Instantiate the Presentation class that represents the presentation + pres = self.Presentation(self.dataDir + "HelloWorld.pptx") + + # Getting Document Properties + dp = pres.getDocumentProperties() + + # Adding Custom properties + dp.set_Item("self.Custom" , 12) + dp.set_Item("My Name","Mudassir") + dp.set_Item("Custom", 124) + + # Saving presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "CustomDemo.pptx", save_format.Pptx) + + print "Added custom properties, please check output file." + + def remove_property(self): + + # Instantiate the Presentation class that represents the presentation + pres = self.Presentation(self.dataDir + "HelloWorld.pptx") + + # Getting Document Properties + dp = pres.getDocumentProperties() + + # Getting property name at particular index + property_name = dp.getPropertyName(1) + + # Removing selected property + dp.remove(property_name) + + # Saving presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "RemoveDP.pptx", save_format.Pptx) + + print "Remove document property, please check output file." + +class Zoom: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + pres = self.Presentation() + + pres.getViewProperties().getNotesViewProperties().setScale(50) + + # Save the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "Zoom.pptx", save_format.Pptx) + + print "Set zoom value, please check the output file." + +class ConvertingToPdf: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate a Presentation object that represents a PPTX file + pres = self.Presentation(self.dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to Pdf format + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose.pdf", save_format.Pdf) + + print "Document has been converted, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.pyc new file mode 100644 index 00000000..cff871a5 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithPresentation/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.py new file mode 100644 index 00000000..7e98d27f --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.py @@ -0,0 +1,459 @@ +__author__ = 'fahadadeel' +import jpype + +class AddingLineShape: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.HtmlOptions=jpype.JClass("com.aspose.slides.HtmlOptions") + self.HtmlFormatter=jpype.JClass("com.aspose.slides.HtmlFormatter") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + # Adding Plain Line to Slide + self.add_plain_line() + + # Adding Arrow Shaped Line to Slide + self.add_arrow_line() + + def add_plain_line(self): + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an autoshape of type line + shapeType = self.ShapeType + sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "LineShape.pptx", save_format.Pptx) + + print "Added plain line to slide, please check the output file." . PHP_EOL + + def add_arrow_line(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an autoshape of type line + shapeType = self.ShapeType() + shp = sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) + + # Apply some formatting on the line + lineStyle = self.LineStyle() + shp.getLineFormat().setStyle(lineStyle.ThickBetweenThin) + shp.getLineFormat().setWidth(10) + + lineDashStyle = self.LineDashStyle() + shp.getLineFormat().setDashStyle(lineDashStyle.DashDot) + + lineArrowheadLength = self.LineArrowheadLength() + lineArrowheadStyle = self.LineArrowheadStyle() + fillType = self.FillType() + color = self.Color() + presetColor = self.PresetColor() + + shp.getLineFormat().setBeginArrowheadLength(lineArrowheadLength.Short) + shp.getLineFormat().setBeginArrowheadStyle(lineArrowheadStyle.Oval) + + shp.getLineFormat().setEndArrowheadLength(lineArrowheadLength.Long) + shp.getLineFormat().setEndArrowheadStyle(lineArrowheadStyle.Triangle) + + shp.getLineFormat().getFillFormat().setFillType(fillType.Solid) + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(self.Color(presetColor.Maroon)) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "ArrowShape.pptx", save_format.Pptx) + + print "Added arrow shape line to slide, please check the output file." . PHP_EOL + +class FillingShapes: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.HtmlOptions=jpype.JClass("com.aspose.slides.HtmlOptions") + self.HtmlFormatter=jpype.JClass("com.aspose.slides.HtmlFormatter") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + + # Filling Shapes with Pattern + self.fill_shapes_with_pattern() + + # Filling Shapes with Picture + self.fill_shapes_with_picture() + + # Filling Shapes with Solid Color + self.fill_shapes_with_solid_color() + + def fill_shapes_with_pattern(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Pattern + fillType = self.FillType() + shp.getFillFormat().setFillType(fillType.Pattern) + + # Set the pattern style + patternStyle = self.PatternStyle() + shp.getFillFormat().getPatternFormat().setPatternStyle(patternStyle.Trellis) + + # Set the pattern back and fore colors + color = self.Color() + shp.getFillFormat().getPatternFormat().getBackColor().setColor(color.LIGHT_GRAY) + shp.getFillFormat().getPatternFormat().getForeColor().setColor(color.YELLOW) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpPatt.pptx", save_format.Pptx) + + print "Filled shapes with Pattern, please check the output file." . PHP_EOL + + def fill_shapes_with_picture(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType() + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Picture + fillType = self.FillType() + shp.getFillFormat().setFillType(fillType.Picture) + + # Set the picture fill mode + pictureFillMode = self.PictureFillMode() + shp.getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Tile) + + # Set the picture + imgx = pres.getImages().addImage(self.FileInprinttream(self.File(self.dataDir + "night.jpg"))) + + shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpPic.pptx", save_format.Pptx) + + print "Filled shapes with Picture, please check the output file." . PHP_EOL + + def fill_shapes_with_solid_color(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType() + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Solid + fillType = self.FillType() + shp.getFillFormat().setFillType(fillType.Solid) + + # Set the color of the rectangle + color = self.Color() + shp.getFillFormat().getSolidFillColor().setColor(color.YELLOW) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpSolid.pptx", save_format.Pptx) + + print "Filled shapes with Solid Color, please check the output file." + +class FindShape: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + # Create an instance of Presentation class + pres=self.Presentation + pres = pres(self.dataDir + 'Aspose.pptx') + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + shape = self.find_shape(slide) + + print "Shape: " + print shape + + def find_shape(self,alttext): + + #Iterating through all shapes inside the slide + i = 0 + pres=self.Presentation() + slide = pres.getSlides().get_Item(0) + while (i < slide.getShapes().size()): + # If the alternative text of the slide matches with the required one then return the shape + if (slide.getShapes().get_Item(i).getAlternativeText() == alttext): + return slide.getShapes().get_Item(i) + + i+=1 + + return None + +class FormatLines: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + + # Formatting the Lines of Shapes + self.format_lines() + + # Formatting the Join Styles + self.format_join_styles() + + def format_lines(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill color of the rectangle shape + fillType = self.FillType() + color = self.Color() + shp.getFillFormat().setFillType(fillType.Solid) + shp.getFillFormat().getSolidFillColor().setColor(color.WHITE) + + # Apply some formatting on the line of the rectangle + + lineStyle = self.LineStyle() + shp.getLineFormat().setStyle(lineStyle.ThickThin) + shp.getLineFormat().setWidth(7) + + lineDashStyle = self.LineDashStyle() + shp.getLineFormat().setDashStyle(lineDashStyle.Dash) + + # set the color of the line of rectangle + shp.getLineFormat().getFillFormat().setFillType(fillType.Solid) + shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpLn.pptx", save_format.Pptx) + + print "Formatted lines, please check the output file." . PHP_EOL + + def format_join_styles(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add three autoshapes of rectangle type + shape_type = self.ShapeType() + shp1 = sld.getShapes().addAutoShape(shape_type.Rectangle, 50, 100, 150, 75) + shp2 = sld.getShapes().addAutoShape(shape_type.Rectangle, 300, 100, 150, 75) + shp3 = sld.getShapes().addAutoShape(shape_type.Rectangle, 50, 250, 150, 75) + + # Set the fill color of the rectangle shape + fill_type = self.FillType() + color = self.Color() + shp1.getFillFormat().setFillType(fill_type.Solid) + shp1.getFillFormat().getSolidFillColor().setColor(color.BLACK) + shp2.getFillFormat().setFillType(fill_type.Solid) + shp2.getFillFormat().getSolidFillColor().setColor(color.BLACK) + shp3.getFillFormat().setFillType(fill_type.Solid) + shp3.getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Set the line width + shp1.getLineFormat().setWidth(15) + shp2.getLineFormat().setWidth(15) + shp3.getLineFormat().setWidth (15) + + # Set the color of the line of rectangle + shp1.getLineFormat().getFillFormat().setFillType(fill_type.Solid) + shp1.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + shp2.getLineFormat().getFillFormat().setFillType(fill_type.Solid) + shp2.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + shp3.getLineFormat().getFillFormat().setFillType(fill_type.Solid) + shp3.getLineFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Set the Join Style + line_join_style = self.LineJoinStyle() + shp1.getLineFormat().setJoinStyle(line_join_style.Miter) + shp2.getLineFormat().setJoinStyle(line_join_style.Bevel) + shp3.getLineFormat().setJoinStyle(line_join_style.Round) + + # Add text to each rectangle + shp1.getTextFrame().setText ("This is Miter Join Style") + shp2.getTextFrame().setText( "This is Bevel Join Style") + shp3.getTextFrame().setText ("This is Round Join Style") + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpLnJoin.pptx", save_format.Pptx) + + print "Formatted join styles, please check the output file." . PHP_EOL + + +class Frame: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.AudioPlayModePreset=jpype.JClass("com.aspose.slides.AudioPlayModePreset") + self.AudioVolumeMode=jpype.JClass("com.aspose.slides.AudioVolumeMode") + self.VideoPlayModePreset=jpype.JClass("com.aspose.slides.VideoPlayModePreset") + self.FileInputStream=jpype.JClass("java.io.FileInputStream") + self.File=jpype.JClass("java.io.File") + + def main(self): + + # Adding Picture Frame to Slide + self.add_picture_frame() + + # Adding Audio Frame to Slide + self.add_audio_frame() + + # Adding Audio Frame to Slide + self.add_video_frame() + + def add_picture_frame(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Instantiate the Image class + imgx = pres.getImages().addImage(self.FileInprinttream(self.File(self.dataDir + "aspose-logo.jpg"))) + + # Add Picture Frame with height and width equivalent of Picture + shapeType = self.ShapeType() + sId.getShapes().addPictureFrame(shapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectPicFrame.pptx", save_format.Pptx) + + print "Added picture frame to slide, please check the output file." + + def add_audio_frame(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Load the wav sound file to stram + fstr=self.FileInputStream() + file=self.File() + fstr = fstr.file.new(self.dataDir + "Bass-Drum.wav") + + # Add Audio Frame + af = sId.getShapes().addAudioFrameEmbedded(50, 150, 100, 100, fstr) + + # Set Play Mode and Volume of the Audio + audioPlayModePreset=self.AudioPlayModePreset() + AudioVolumeMode=self.AudioVolumeMode() + af.setPlayMode(audioPlayModePreset.Auto) + af.setVolume(AudioVolumeMode.Loud) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.data_dir + "AudioFrameEmbed.pptx", save_format.Pptx) + + print "Added audio frame to slide, please check the output file." .PHP_EOL + + def add_video_frame(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Add Video Frame + vf = sId.getShapes().addVideoFrame(50, 150, 300, 150, self.dataDir + "Wildlife.mp4") + + # Set Play Mode and Volume of the Video + videoPlayModePreset=self.VideoPlayModePreset() + audioVolumeMode=self.AudioVolumeMode() + vf.setPlayMode(videoPlayModePreset.Auto) + vf.setVolume(audioVolumeMode.Loud) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "VideoFrame.pptx", save_format.Pptx) + + print "Added video frame to slide, please check the output file.".PHP_EOL + +class RotatingShapes: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Rotate the shape to 90 degree + shp.setRotation(90) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat() + pres.save(self.dataDir + "RectShpRot.pptx", save_format.Pptx) + + print "Rotated shape, please check the output file." . PHP_EOL diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.pyc new file mode 100644 index 00000000..834b7252 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithShapes/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.py new file mode 100644 index 00000000..9c3ed62f --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.py @@ -0,0 +1,570 @@ +__author__ = 'fahadadeel' +import jpype + +class AccessSlides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Using Slides Collection to Access Slide by Index + AccessSlides.get_slide_by_index(self.dataDir) + + # Using Slides Collection to Access Slide by ID + AccessSlides.get_slide_by_id(self.dataDir) + + def get_slide_by_index(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Accessing a slide using its slide index + slide = pres.getSlides().get_Item(0) + + print "Slide: " . slide + + def get_slide_by_id(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation() + pres = pres(self.dataDir + 'Aspose.pptx') + + # Getting Slide ID + id = pres.getSlides().get_Item(0).getSlideId() + + # Accessing Slide by ID + slide = pres.getSlideById(id) + + print "Slide: " . slide + +class AddSlides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Instantiate SlideCollection calss + slides = pres.getSlides() + + i = 0 + while (i < pres.getLayoutSlides().size()): + + # Add an empty slide to the Slides collection + slides.addEmptySlide(pres.getLayoutSlides().get_Item(i)) + i+=1 + + + + #Do some work on the newly added slide + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "EmptySlide.pptx", save_format.Pptx) + + print "Document has been created, please check the output file." + +class Background: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.BackgroundType=jpype.JClass("com.aspose.slides.BackgroundType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.PictureFillMode=jpype.JClass("com.aspose.slides.PictureFillMode") + self.Color=jpype.JClass("java.awt.Color") + self.File=jpype.JClass("java.io.File") + self.FileInputStream=jpype.JClass("java.io.FileInputStream") + + def main(self): + + # Setting the Background Color of a Master Slide + self.set_background_color_of_master_slide() + + # Setting the Background Color of a Normal Slide + self.set_background_color_of_normal_slide() + + # Setting the Slide Background to an Image + self.set_image_as_background_color() + + def set_background_color_of_master_slide(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Set the background color of the Master Slide to Forest Green + backgroundType = self.BackgroundType + fillType = self.FillType + color = self.Color + + pres.getMasters().get_Item(0).getBackground().setType(backgroundType.OwnBackground) + pres.getMasters().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Solid) + pres.getMasters().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(color.GREEN) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "MasterBG.pptx", save_format.Pptx) + + print "Set background color of master slide, please check the output file." + + def set_background_color_of_normal_slide(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Set the background color of the Normal slide to Blue + + backgroundType = self.BackgroundType + fillType = self.FillType + color = self.Color + + pres.getSlides().get_Item(0).getBackground().setType(backgroundType.OwnBackground) + pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Solid) + pres.getSlides().get_Item(0).getBackground().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "ContentBG.pptx", save_format.Pptx) + + print "Set background color of normal slide, please check the output file." + + def set_image_as_background_color(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation + + # Set the background with Image + + backgroundType = self.BackgroundType + fillType = self.FillType + pictureFillMode = self.PictureFillMode + + pres.getSlides().get_Item(0).getBackground().setType(backgroundType.OwnBackground) + pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(fillType.Picture) + pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Stretch) + + # Set the picture + imgx = pres.getImages().addImage(self.FileInputStream(self.File(self.dataDir + 'night.jpg'))) + + # Image imgx = pres.getImages().addImage(image) + # Add image to presentation's images collection + + pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "ContentBG_Image.pptx", save_format.Pptx) + + print "Set image as background, please check the output file." + +class ChangingPosition: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Get the slide whose position is to be changed + slide = pres.getSlides().get_Item(0) + + # Set the self.position for the slide + slide.setSlideNumber(1) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose_Position.pptx", save_format.Pptx) + + print "Changes slide position, please check the output file." + +class CloneSlides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Within the Same Presentation from One Position to the End + self.clone_to_end_of_presentation() + + # From One Position to Anther within the Same Presentation + self.clone_to_aonther_position() + + # In Another Presentation at the End of the Existing Slides + self.clone_to_other_presentation_at_end_of_existing_slide() + + def clone_to_end_of_presentation(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Clone the desired slide to the end of the collection of slides in the same presentation + slides = pres.getSlides() + slides.addClone(pres.getSlides().get_Item(0)) + + # Saving the presentation file + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose_Cloned.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + + def clone_to_aonther_position(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Clone the desired slide to the end of the collection of slides in the same presentation + slides = pres.getSlides() + + # Clone the desired slide to the specified index in the same presentation + slides.insertClone(1, pres.getSlides().get_Item(0)) + + # Saving the presentation file + save_format = self.SaveFormat + pres.save(self.dataDir + "Aspose_Cloned.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + + def clone_to_other_presentation_at_end_of_existing_slide(self): + + # Instantiate Presentation class that represents the presentation file + src_pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Instantiate Presentation class for destination PPTX (where slide is to be cloned) + dest_pres = self.Presentation() + + # Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation + slds = dest_pres.getSlides() + + slds.addClone(src_pres.getSlides().get_Item(0)) + + # Saving the presentation file + save_format = self.SaveFormat + dest_pres.save(self.dataDir + "Aspose_dest2.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + +class CreatingSvg: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FileOutputStream=jpype.JClass("java.io.FileOutputStream") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation + pres = pres(self.dataDir + 'Aspose.pptx') + + # Getting last slide index + last_slide_position = pres.getSlides().size() + + #Iterating through every presentation slide and generating SVG image + i = 0 + while (i < last_slide_position): + + # Accessing Slides + slide = pres.getSlides().get_Item(i) + + # Getting and saving the slide SVG image + slide.writeAsSvg(self.FileOutputStream(self.dataDir + "SvgImage#i.svg")) + + i+=1 + print "Created SVG images, please check output files." + +class Hyperlinks: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation + pres = pres(self.dataDir + 'Aspose.pptx') + + # Removing the hyperlinks from presentation + pres.getHyperlinkQueries().removeAllHyperlinks() + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Hyperlinks.pptx", save_format.Pptx) + + print "Removed hyperlinks successfully, please check the output file." + +class RemoveSlides: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Using Slides Collection to Remove Slide by Index + self.remove_slide_by_index() + + # Using Slides Collection to Remove Slide by ID + self.remove_slide_by_id() + + def remove_slide_by_index(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Accessing a slide using its slide index + slide = pres.getSlides().get_Item(0) + + # Removing a slide using its reference + pres.getSlides().remove(slide) + + # Saving the presentation file + save_format = self.SaveFormat + pres.save(self.dataDir + "Modified.pptx", save_format.Pptx) + + print "Removed slide by Index, please check the output file." + + def remove_slide_by_id(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + # Removing a slide using its slide index + pres.getSlides().removeAt(0) + + # Saving the presentation file + save_format = self.SaveFormat + pres.save(self.dataDir + "Modified.pptx", save_format.Pptx) + + print "Removed slide by ID, please check the output file." + +class SizeAndLayout: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.SlideSizeType=jpype.JClass("com.aspose.slides.SlideSizeType") + self.slidesOptions=jpype.JClass("com.aspose.slides.PdfOptions") + + def main(self): + + # Setting the Size and Type of a slide + self.set_size_and_type() + + # Setting the page size when generating slides + self.set_page_size_for_slides() + + def set_size_and_type(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + aux_pres = self.Presentation() + + slide = pres.getSlides().get_Item(0) + + # Set the slide size of generated presentations to that of source + aux_pres.getSlideSize().setType(pres.getSlideSize().getType()) + aux_pres.getSlideSize().setSize(pres.getSlideSize().getSize()) + + # Clone required slide + aux_pres.getSlides().addClone(pres.getSlides().get_Item(0)) + aux_pres.getSlides().removeAt(0) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Slide_Size_Type.pptx", save_format.Pptx) + + print "Set slide size and type, please check the output file." + + def set_page_size_for_slides(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation() + + # Set SlideSize.Type Property + slideSizeType = self.SlideSizeType + pres.getSlideSize().setType(slideSizeType.A4Paper) + + # Set different properties of slides Options + opts = self.slidesOptions + opts.setSufficientResolution(600) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "Export.slides", save_format.slides, opts) + + print "Set page size for slides, please check the output file." + +class Thumbnail: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ImageIO=jpype.JClass("javax.ImageIO") + self.File=jpype.JClass("java.io.File") + + def main(self): + + # Generating a Thumbnail from a Slide + self.create_thumbnail() + + # Generating a Thumbnail from a Slide with User Defined Dimensions + self.create_thumbnail_custom_size() + + # Generating a Thumbnail from a Slide in Notes Slides View + self.create_thumbnail_in_notes_slides_view() + + # Generating a Thumbnail of User Defined Window from a Slide + self.create_thumbnail_of_user_defined_window() + + def create_thumbnail(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation + pres = pres(self.dataDir + 'Aspose.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # Create a full scale image + image = slide.getThumbnail() + + # Save the image to disk in JPEG format + imageIO = self.ImageIO() + + imageIO.write(image, "jpeg", self.File(self.dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail, please check the output file." + + def create_thumbnail_custom_size(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation() + pres = pres(self.dataDir + 'Aspose.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # User defined dimension + desired_x = 1200 + desired_y = 800 + + # Getting scaled value of X and Y + scale_x = (1.0 / pres.getSlideSize().getSize().getWidth()) * desired_x + scale_y = (1.0 / pres.getSlideSize().getSize().getHeight()) * desired_y + + # Create a full scale image + image = slide.getThumbnail(scale_x, scale_y) + + # Save the image to disk in JPEG format + imageIO = self.ImageIO() + imageIO.write(image, "jpeg", self.File(self.dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail with custom size, please check the output file." + + def create_thumbnail_in_notes_slides_view(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation() + pres = pres(self.dataDir + 'Aspose.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # User defined dimension + desired_x = 1200 + desired_y = 800 + + # Getting scaled value of X and Y + scale_x = (1.0 / pres.getSlideSize().getSize().getWidth()) * desired_x + scale_y = (1.0 / pres.getSlideSize().getSize().getHeight()) * desired_y + + # Create a full scale image + image = slide.getNotesSlide().getThumbnail(scale_x, scale_y) + + # Save the image to disk in JPEG format + imageIO = self.ImageIO() + imageIO.write(image, "jpeg", self.File(self.dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail in notes slides view, please check the output file." + + def create_thumbnail_of_user_defined_window(self): + + # Instantiate Presentation class that represents the presentation file + pres=self.Presentation() + pres = pres(self.dataDir + 'Aspose.pptx') + + # Access the first slide + slide = pres.getSlides().get_Item(0) + + # Create a full scale image + image = slide.getThumbnail(1,1) + + # Getting the image of desired window inside generated slide thumnbnail + # BufferedImage window = image.getSubimage(windowX, windowY, windowsWidth, windowHeight) + window_image = image.getSubimage(100, 100, 200, 200) + + # Save the image to disk in JPEG format + imageIO = self.ImageIO() + imageIO.write(image, "jpeg", self.File(self.dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail of user defined window, please check the output file." + +class Transitions: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TransitionType=jpype.JClass("com.aspose.slides.TransitionType") + + def main(self): + + # Instantiate Presentation class that represents the presentation file + pres = self.Presentation(self.dataDir + 'Aspose.pptx') + + transition_type = self.TransitionType + + # Apply circle type transition on slide 1 + pres.getSlides().get_Item(0).getSlideShowTransition().setType(transition_type.Circle) + + # Apply comb type transition on slide 2 + pres.getSlides().get_Item(0).getSlideShowTransition().setType(transition_type.Comb) + + # Saving the presentation + save_format = self.SaveFormat + pres.save(self.dataDir + "SimpleTransition.pptx", save_format.Pptx) + + print "Done with simple transition, please check the output file." + diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.pyc new file mode 100644 index 00000000..3d1b814d Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.py new file mode 100644 index 00000000..8165f2ca --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.py @@ -0,0 +1,79 @@ +__author__ = 'fahadadeel' +import jpype + +class AddSmartArt: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.SmartArtLayoutType=jpype.JClass("com.aspose.slides.SmartArtLayoutType") + + + def main(self): + + self.create_smartart_shape() + + + def create_smartart_shape(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add Smart Art Shape + smartArtLayoutType = self.SmartArtLayoutType + smart = slide.getShapes().addSmartArt(0, 0, 400, 400, smartArtLayoutType.BasicBlockList) + + # Write the presentation as a PPTX file + saveFormat = self.SaveFormat + pres.save(self.dataDir + "SimpleSmartArt.pptx", saveFormat.Pptx) + + print "Created smartart shape, please check the output file." + + +class FillFormat: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.SmartArtLayoutType=jpype.JClass("com.aspose.slides.SmartArtLayoutType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + + + def main(self): + + self.create_smartart_shape() + + + def create_smartart_shape(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Adding SmartArt shape and nodes + smartArtLayoutType = self.SmartArtLayoutType + chevron = slide.getShapes().addSmartArt(10, 10, 800, 60, smartArtLayoutType.ClosedChevronProcess) + node = chevron.getAllNodes().addNode() + node.getTextFrame().setText("Some text") + + # Setting node fill color + color = self.Color + fillType = self.FillType + item = node.getShapes().get_Item(0) + item.getFillFormat().setFillType(fillType.Solid) + item.getFillFormat().getSolidFillColor().setColor(color.RED) + + # Write the presentation as a PPTX file + saveFormat = self.SaveFormat + pres.save(dataDir + "FillFormat.pptx", saveFormat.Pptx) + + print "Set fill format for smartart node, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.pyc new file mode 100644 index 00000000..afe046c7 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithSmartArt/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.py new file mode 100644 index 00000000..2e190f00 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.py @@ -0,0 +1,286 @@ +__author__ = 'fahadadeel' +import jpype + +class AddImage: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TextAnchorType=jpype.JClass("com.aspose.slides.TextAnchorType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.TextVerticalType=jpype.JClass("com.aspose.slides.TextVerticalType") + self.ImageIO=jpype.JClass("javax.ImageIO") + self.Color=jpype.JClass("java.awt.Color") + + + def main(self): + + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Define co lumns with widths and rows with heights + dbl_cols = [150,150,150,150] + dbl_rows = [100,100,100,100,90] + + # Add table shape to slide + tbl = sld.getShapes().addTable(50, 50, dbl_cols, dbl_rows) + + # Creating a Buffered Image object to hold the image file + imageIO = ImageIO() + image = imageIO.read(File(dataDir + "aspose-logo.jpg")) + imgx1 = pres.getImages().addImage(image) + + fillType=FillType() + pictureFillMode=PictureFillMode() + tbl.get_Item(0,0).getFillFormat().setFillType(fillType.Picture) + tbl.get_Item(0,0).getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Stretch) + tbl.get_Item(0,0).getFillFormat().getPictureFillFormat().getPicture().setImage(imgx1) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(self.dataDir + "AddImage.pptx", save_format.Pptx) + + print "Added image, please check the output file." + + +class AlignText: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.TextAnchorType=jpype.JClass("com.aspose.slides.TextAnchorType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.TextVerticalType=jpype.JClass("com.aspose.slides.TextVerticalType") + self.ImageIO=jpype.JClass("javax.ImageIO") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Define columns with widths and rows with heights + dbl_cols = [120, 120, 120, 120] + dbl_rows = [100, 100, 100, 100] + + # Add table shape to slide + tbl = slide.getShapes().addTable(100, 50, dbl_cols, dbl_rows) + + # Add text to the merged cell + tbl.getRows().get_Item(0).get_Item(1).getTextFrame().setText("10") + tbl.getRows().get_Item(0).get_Item(2).getTextFrame().setText("20") + tbl.getRows().get_Item(0).get_Item(3).getTextFrame().setText("30") + + # Accessing the text frame + txt_frame = tbl.getRows().get_Item(0).get_Item(0).getTextFrame() + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + + fillType=FillType() + color=Color() + + portion = para.getPortions().get_Item(0) + portion.setText("Text here") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Aligning the text vertically + textVerticalType=TextVerticalType() + cell = tbl.getRows().get_Item(0).get_Item(0) + textAnchorType=TextAnchorType() + cell.setTextAnchorType(textAnchorType.Center) + cell.setTextVerticalType(textVerticalType.Vertical270) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "AlignText.pptx", save_format.Pptx) + + print "Aligned Text, please check the output file." + + +class CloneRowColumn: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Define columns with widths and rows with heights + dbl_cols = [50, 50, 50] + dbl_rows = [50, 30, 30, 30] + + # Add table shape to slide + tbl = sld.getShapes().addTable(100, 50, dbl_cols, dbl_rows) + + fill_type = self.FillType + color = self.Color + + # Set border format for each cell + row = 0 + while (row < tbl.getRows().size()): + cell = 0 + while (cell < tbl.getRows().get_Item(row).size()): + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().setWidth(5) + + cell += 1 + + row += 1 + + + tbl.getColumns().get_Item(0).get_Item(0).getTextFrame().setText("00") + tbl.getColumns().get_Item(0).get_Item(1).getTextFrame().setText("01") + tbl.getColumns().get_Item(0).get_Item(2).getTextFrame().setText("02") + tbl.getColumns().get_Item(0).get_Item(3).getTextFrame().setText("03") + tbl.getColumns().get_Item(1).get_Item(0).getTextFrame().setText("10") + tbl.getColumns().get_Item(2).get_Item(0).getTextFrame().setText("20") + tbl.getColumns().get_Item(1).get_Item(1).getTextFrame().setText("11") + tbl.getColumns().get_Item(2).get_Item(1).getTextFrame().setText("21") + + # AddClone adds a row in the end of the table + tbl.getRows().addClone(tbl.getRows().get_Item(0) , False) + + # AddClone adds a column in the end of the table + tbl.getColumns().addClone(tbl.getColumns().get_Item(0), False) + + # InsertClone adds a row at specific position in a table + tbl.getRows().insertClone(2, tbl.getRows().get_Item(0), False) + + # InsertClone adds a row at specific position in a table + tbl.getColumns().insertClone(2, tbl.getColumns().get_Item(0), False) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "CloneRowColumn.pptx", save_format.Pptx) + + print "Cloned Row & Column from table, please check the output file." + +class CreateTable: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Define columns with widths and rows with heights + dblCols = [50, 50, 50] + dblRows = [50, 30, 30, 30, 30] + + # Add table shape to slide + tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows) + + fill_type = self.FillType + color = self.Color + + # Set border format for each cell + row = 0 + while (row < tbl.getRows().size()): + cell = 0 + while (cell < tbl.getRows().get_Item(row).size()): + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderTop().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderBottom().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderLeft().setWidth(5) + + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().setFillType(fill_type.Solid) + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().getFillFormat().getSolidFillColor().setColor(color.RED) + tbl.getRows().get_Item(row).get_Item(cell).getBorderRight().setWidth(5) + + cell+=1 + + row+=1 + + + # Merge cells 1 & 2 of row 1 + tbl.mergeCells(tbl.getRows().get_Item(0).get_Item(0), tbl.getRows().get_Item(1).get_Item(0), False) + + # Add text to the merged cell + tbl.getRows().get_Item(0).get_Item(0).getTextFrame().setText("Merged Cells") + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(self.dataDir + "CreateTable.pptx", save_format.Pptx) + + print "Created table, please check the output file." + +class RemoveRowColumn: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + pres = self.Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + col_width = [100, 50, 30] + row_height = [30, 50, 30] + + table = slide.getShapes().addTable(100, 100, col_width, row_height) + + table.getRows().removeAt(1, False) + table.getColumns().removeAt(1, False) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "RemoveRowColumn.pptx", save_format.Pptx) + + print "Removed Row & Column from table, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.pyc new file mode 100644 index 00000000..1eba3b00 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithTables/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.py b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.py new file mode 100644 index 00000000..e2ebb143 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.py @@ -0,0 +1,512 @@ +__author__ = 'fahadadeel' +import jpype + +class CreateTextBox: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + + def main(self): + + # Creating a TextBox on Slide + self.create_textbox() + + # Creating a TextBox with Hyperlink + self.create_textbox_with_hyperlink() + + def create_textbox(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 150, 50) + + # Add TextFrame to the Rectangle + shp.addTextFrame(" ") + + # Accessing the text frame + txt_frame = shp.getTextFrame() + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + portion = para.getPortions().get_Item(0) + + # Set Text + portion.setText("Aspose TextBox") + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "TextBox.pptx", save_format.Pptx) + + print "Created TextBox, please check the output file." + + def create_textbox_with_hyperlink(self): + + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = self.ShapeType + pptxShape = sld.getShapes().addAutoShape(shapeType.Rectangle, 150, 150, 150, 50) + + # Cast the shape to AutoShape + pptxAutoShape = pptxShape + + # Access ITextFrame associated with the AutoShape + pptxAutoShape.addTextFrame("") + + text_frame = pptxAutoShape.getTextFrame() + + # Add some text to the frame + text_frame.getParagraphs().get_Item(0).getPortions().get_Item(0).setText("Aspose.Slides") + + #Set Hyperlink for the portion text + hypman = text_frame.getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkManager() + hypman.setExternalHyperlinkClick("http://www.aspose.com") + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "hLinkPPTX.pptx", save_format.Pptx) + + print "Created TextBox with Hyperlink, please check the output file." + +class ManageText: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.TextAutofitType=jpype.JClass("com.aspose.slides.TextAutofitType") + self.TextAnchorType=jpype.JClass("com.aspose.slides.TextAnchorType") + self.TextVerticalType=jpype.JClass("com.aspose.slides.TextVerticalType") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Setting the AutofitType property of text frame + self.set_autofittype_of_text() + + # Setting the anchor of TextFrame + self.set_anchor_of_text() + + # Rotating the text + self.rotate_text() + + def set_autofittype_of_text(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) + + # Add TextFrame to the Rectangle + fillType = self.FillType + ashp.addTextFrame(" ") + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Accessing the text frame + txt_frame = ashp.getTextFrame() + + # Setting text autofit type + textAutofitType=TextAutofitType + txt_frame.getTextFrameFormat().setAutofitType(textAutofitType.Shape) + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + color = self.Color + portion = para.getPortions().get_Item(0) + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "formatText.pptx", save_format.Pptx) + + print "Set autofittype of text, please check the output file." + + def set_anchor_of_text(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) + + # Add TextFrame to the Rectangle + fillType = self.FillType + ashp.addTextFrame(" ") + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Accessing the text frame + txt_frame = ashp.getTextFrame() + + # Setting text anchoring to bottom + textAnchorType=TextAnchorType + txt_frame.getTextFrameFormat().setAnchoringType(textAnchorType.Bottom) + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + color = self.Color + portion = para.getPortions().get_Item(0) + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "AnchorText.pptx", save_format.Pptx) + + print "Set anchor of text, please check the output file." + + def rotate_text(self): + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 350, 350) + + # Add TextFrame to the Rectangle + fillType=FillType + ashp.addTextFrame(" ") + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Accessing the text frame + txt_frame = ashp.getTextFrame() + + # Setting text Vertical type + textVerticalType=TextVerticalType + txt_frame.getTextFrameFormat().setTextVerticalType(textVerticalType.Vertical270) + + # Create the Paragraph object for text frame + para = txt_frame.getParagraphs().get_Item(0) + + # Create Portion object for paragraph + portion = para.getPortions().get_Item(0) + color=Color + portion.setText("A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.") + portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "VerticleText.pptx", save_format.Pptx) + + print "Done with text rotation, please check the output file." + +class ReplaceText: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + + def main(self): + + # Create an instance of Presentation class + pres = self.Presentation(self.dataDir + 'Welcome.pptx') + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Change the text of each placeholder + shp = sld.getShapes().get_Item(0) + shp.getTextFrame().setText("This is Placeholder") + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "Welcome_PH.pptx", save_format.Pptx) + + print "Replaced text, please check the output file." + +class ShadowEffects: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.RectangleAlignment=jpype.JClass("com.aspose.slides.RectangleAlignment") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=ShapeType + shp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 150, 50) + + # Add TextFrame to the Rectangle + shp.addTextFrame("Aspose TextBox") + + # Disable shape fill in case we want to get shadow of text + fillType = self.FillType + shp.getFillFormat().setFillType(fillType.NoFill) + + # Add outer shadow and set all necessary parameters + shp.getEffectFormat().enableOuterShadowEffect() + shadow = shp.getEffectFormat().getOuterShadowEffect() + shadow.setBlurRadius(4.0) + shadow.setDirection(45) + shadow.setDistance(3) + + rectangleAlignment=RectangleAlignment + + color = self.Color + + shadow.setRectangleAlign(rectangleAlignment.TopLeft) + shadow.getShadowColor().setColor(color.black) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "OutShadow.pptx", save_format.Pptx) + + print "Applied shadow effects on text, please check the output file." + +class TextFont: + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.FontData=jpype.JClass("com.aspose.slides.FontData") + self.NullableBool=jpype.JClass("com.aspose.slides.NullableBool") + self.TextUnderlineType=jpype.JClass("com.aspose.slides.TextUnderlineType") + self.LoadFormat=jpype.JClass("com.aspose.slides.LoadFormat") + self.LoadOptions=jpype.JClass("com.aspose.slides.LoadOptions") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Managing Font Related Properties + self.font_properties() + + # Managing Font Family of Text + self.font_family_of_text() + + # Using Default Fonts for Rendering Presentation + self.set_default_font_for_rendering() + + def font_properties(self): + + # Create an instance of Presentation class + pres = self.Presentation(self.dataDir + 'Welcome.pptx') + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Accessing the first and second placeholder in the slide and typecasting it as AutoShape + tf1 = slide.getShapes().get_Item(0).getTextFrame() + tf2 = slide.getShapes().get_Item(1).getTextFrame() + + # Accessing the first Paragraph + para1 = tf1.getParagraphs().get_Item(0) + para2 = tf2.getParagraphs().get_Item(0) + + # Accessing the first portion + port1 = para1.getPortions().get_Item(0) + port2 = para2.getPortions().get_Item(0) + + # Define fonts + fd1 = self.FontData("Elephant") + fd2 = self.FontData("Castellar") + + # Assign fonts to portion + port1.getPortionFormat().setLatinFont(fd1) + port2.getPortionFormat().setLatinFont(fd2) + + # Set font to Bold + nullableBool = self.NullableBool + port1.getPortionFormat().setFontBold(nullableBool.True) + port2.getPortionFormat().setFontBold(nullableBool.True) + + # Set font to Italic + port1.getPortionFormat().setFontItalic(nullableBool.True) + port2.getPortionFormat().setFontItalic(nullableBool.True) + + # Set font color + fillType = self.FillType + color = self.Color + port1.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port1.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + port2.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port2.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.GREEN) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "WelcomeFont.pptx", save_format.Pptx) + + print "Done with font properties, please check the output file." + + def font_family_of_text(self): + + # Create an instance of Presentation class + pres = self.Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType = self.ShapeType + ashp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 50, 200, 50) + + # Remove any fill style associated with the AutoShape + fillType=FillType + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Access the TextFrame associated with the AutoShape + tf = ashp.getTextFrame() + tf.setText("Aspose TextBox") + + # Access the Portion associated with the TextFrame + port = tf.getParagraphs().get_Item(0).getPortions().get_Item(0) + + # Set the Font for the Portion + port.getPortionFormat().setLatinFont(FontData("Times New Roman")) + + # Set Bold property of the Font + nullableBool=NullableBool + port.getPortionFormat().setFontBold(nullableBool.True) + + # Set Italic property of the Font + port.getPortionFormat().setFontItalic(nullableBool.True) + + # Set Underline property of the Font + textUnderlineType=TextUnderlineType + port.getPortionFormat().setFontUnderline(textUnderlineType.Single) + + # Set the Height of the Font + port.getPortionFormat().setFontHeight(25) + + # Set the color of the Font + color = self.Color + port.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "FontFamilyOfText.pptx", save_format.Pptx) + + print "Done with font family for text, please check the output file." + + + def set_default_font_for_rendering(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' + # Use load options to define the default regualr and asian fonts + + loadFormat = LoadFormat + lo = LoadOptions(loadFormat.Auto) + lo.setDefaultRegularFont("Wingdings") + lo.setDefaultAsianFont("Wingdings") + + # Create an instance of Presentation class + pres = Presentation(self.dataDir + 'input.pptx') + + # Generate PDF + save_format = self.SaveFormat + pres.save(self.dataDir + "output.pdf", save_format.Pdf) + + print "Done with font family for text, please check the output file." + +class WordArt: + + def __init__(self, dataDir): + print "init func" + self.dataDir = dataDir + self.Presentation=jpype.JClass("com.aspose.slides.Presentation") + self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat") + self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType") + self.FillType=jpype.JClass("com.aspose.slides.FillType") + self.RectangleAlignment=jpype.JClass("com.aspose.slides.RectangleAlignment") + self.ColorType=jpype.JClass("com.aspose.slides.ColorType") + self.SchemeColor=jpype.JClass("com.aspose.slides.SchemeColor") + self.Color=jpype.JClass("java.awt.Color") + + def main(self): + + # Create an instance of Presentation class + pres = self.Presentation + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType = self.ShapeType + fillType = self.FillType + ashp = slide.getShapes().addAutoShape(shapeType.Rectangle, 150, 75, 400, 300) + ashp.getFillFormat().setFillType(fillType.NoFill) + + # Add TextFrame to the Rectangle + ashp.addTextFrame("Aspose TextBox") + port = ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0) + pf = port.getPortionFormat() + pf.setFontHeight(50) + + # Enable InnerShadowEffect + ef = pf.getEffectFormat() + ef.enableInnerShadowEffect() + + # Set all necessary parameters + ef.getInnerShadowEffect().setBlurRadius(8.0) + ef.getInnerShadowEffect().setDirection(90) + ef.getInnerShadowEffect().setDistance(6.0) + ef.getInnerShadowEffect().getShadowColor().setB(189) + + # Set ColorType as Scheme + colorType = self.ColorType + ef.getInnerShadowEffect().getShadowColor().setColorType(colorType.Scheme) + + # Set Scheme Color + schemeColor = self.SchemeColor + ef.getInnerShadowEffect().getShadowColor().setSchemeColor(schemeColor.Accent1) + + # Write the presentation as a PPTX file + save_format = self.SaveFormat + pres.save(self.dataDir + "WordArt.pptx", save_format.Pptx) + + print "Done with word art, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.pyc b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.pyc new file mode 100644 index 00000000..48e45b18 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/WorkingWithText/__init__.pyc differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/aspose_slides_java_for_python.py b/Plugins/Aspose-Slides-Java-for-Python/aspose_slides_java_for_python.py new file mode 100644 index 00000000..a90e3ed0 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/aspose_slides_java_for_python.py @@ -0,0 +1,9 @@ +# To change this license header, choose License Headers in Project Properties. +# To change this template file, choose Tools | Templates +# and open the template in the editor. + +__author__ = "nhp09" +__date__ = "$Apr 4, 2016 10:38:05 AM$" + +if __name__ == "__main__": + print "Hello World" diff --git a/Plugins/Aspose-Slides-Java-for-Python/setup.py b/Plugins/Aspose-Slides-Java-for-Python/setup.py new file mode 100644 index 00000000..31bcef1c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/setup.py @@ -0,0 +1,19 @@ +__author__ = 'fahadadeel' + +from setuptools import setup, find_packages + +setup( + name = 'aspose-slides-java-for-python', + packages = find_packages(), + version = '1.0', + description = 'Aspose.Slides Java for Python is a project that demonstrates / provides the Aspose.Slides for Java API usage examples in Python.', + author='Fahad Adeel', + author_email='slides@aspose.com', + url='http://www.aspose.com/docs/display/slidesjava/Aspose.Slides+Java+for+Python', + classifiers=[ + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent' + ] +) \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/HelloWorld.py b/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/HelloWorld.py new file mode 100644 index 00000000..b7d1c257 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/HelloWorld.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from IntroductionToPresentation import HelloWorld + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = HelloWorld('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/data/HelloWorld.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/data/HelloWorld.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/IntroductionToPresentation/HelloWorld/data/HelloWorld.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartLegend/ChartLegend.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartLegend/ChartLegend.py new file mode 100644 index 00000000..b89bd06d --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartLegend/ChartLegend.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ChartLegend + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChartLegend('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartProperties/ChartProperties.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartProperties/ChartProperties.py new file mode 100644 index 00000000..66fa1490 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartProperties/ChartProperties.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ChartProperties + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChartProperties('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartSeries/ChartSeries.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartSeries/ChartSeries.py new file mode 100644 index 00000000..888a4a56 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartSeries/ChartSeries.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ChartSeries + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChartSeries('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartTrendLines/ChartTrendLines.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartTrendLines/ChartTrendLines.py new file mode 100644 index 00000000..83128b05 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ChartTrendLines/ChartTrendLines.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ChartTrendLines + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChartTrendLines('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/CreateChart/CreateChart.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/CreateChart/CreateChart.py new file mode 100644 index 00000000..b2e130ce --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/CreateChart/CreateChart.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import CreateChart + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CreateChart('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ErrorBars/ErrorBars.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ErrorBars/ErrorBars.py new file mode 100644 index 00000000..adabea18 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ErrorBars/ErrorBars.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ErrorBars + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ErrorBars('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/ExistingChart.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/ExistingChart.py new file mode 100644 index 00000000..21da9753 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/ExistingChart.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import ExistingChart + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ExistingChart('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChart.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChart.pptx new file mode 100644 index 00000000..575c1c98 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChart.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChartModified.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChartModified.pptx new file mode 100644 index 00000000..a0e4ee8d Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChartModified.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/FormattingChartEntities/FormattingChartEntities.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/FormattingChartEntities/FormattingChartEntities.py new file mode 100644 index 00000000..4d85c087 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/FormattingChartEntities/FormattingChartEntities.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import FormattingChartEntities + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FormattingChartEntities('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetLabelDistance/SetLabelDistance.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetLabelDistance/SetLabelDistance.py new file mode 100644 index 00000000..1005e2b9 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetLabelDistance/SetLabelDistance.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import SetLabelDistance + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = SetLabelDistance('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetPieChartColors/SetPieChartColors.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetPieChartColors/SetPieChartColors.py new file mode 100644 index 00000000..a8adb633 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/SetPieChartColors/SetPieChartColors.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithCharts import SetPieChartColors + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = SetPieChartColors('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/ConvertingToHtml.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/ConvertingToHtml.py new file mode 100644 index 00000000..65abff88 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/ConvertingToHtml.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToHtml + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToHtml('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.html b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.html new file mode 100644 index 00000000..5d27ce55 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.html @@ -0,0 +1,30 @@ + + +
+ + + + + + \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToHtml/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/ConvertingToNotes.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/ConvertingToNotes.py new file mode 100644 index 00000000..6d5b93d0 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/ConvertingToNotes.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToNotes + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToNotes('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Notes.tiff b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Notes.tiff new file mode 100644 index 00000000..fe5808ce Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToNotes/data/Notes.tiff differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/ConvertingToPdf.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/ConvertingToPdf.py new file mode 100644 index 00000000..e256ea5e --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/ConvertingToPdf.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToPdf + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToPdf('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pdf b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pdf new file mode 100644 index 00000000..103d9151 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pdf differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToPdf/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/ConvertingToTiff.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/ConvertingToTiff.py new file mode 100644 index 00000000..f042b275 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/ConvertingToTiff.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToTiff + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToTiff('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose-Custom-Size.tiff b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose-Custom-Size.tiff new file mode 100644 index 00000000..caa34235 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose-Custom-Size.tiff differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.tiff b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.tiff new file mode 100644 index 00000000..2e00362a Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToTiff/data/Aspose.tiff differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/ConvertingToXps.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/ConvertingToXps.py new file mode 100644 index 00000000..7dfda974 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/ConvertingToXps.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import ConvertingToXps + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ConvertingToXps('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose-Custom-Size.xps b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose-Custom-Size.xps new file mode 100644 index 00000000..a23f6632 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose-Custom-Size.xps differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.xps b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.xps new file mode 100644 index 00000000..ec643684 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/ConvertingToXps/data/Aspose.xps differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/OdpToPptx.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/OdpToPptx.py new file mode 100644 index 00000000..750c8c89 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/OdpToPptx.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import OdpToPptx + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = OdpToPptx('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.odp b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.odp new file mode 100644 index 00000000..e68d10c6 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.odp differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.pptx new file mode 100644 index 00000000..775b2406 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/OdpToPptx/data/Source.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/PptToPptx.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/PptToPptx.py new file mode 100644 index 00000000..7af65002 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/PptToPptx.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import PptToPptx + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = PptToPptx('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Aspose.pptx new file mode 100644 index 00000000..0738bb7c Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Presentation1.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Presentation1.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/PptToPptx/data/Presentation1.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/Properties.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/Properties.py new file mode 100644 index 00000000..56a44d3a --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/Properties.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import Properties + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Properties('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/CustomDemo.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/CustomDemo.pptx new file mode 100644 index 00000000..0d3d031c Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/CustomDemo.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/DocProps.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/DocProps.pptx new file mode 100644 index 00000000..bdc0470e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/DocProps.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/HelloWorld.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/HelloWorld.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Properties/data/HelloWorld.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/Zoom.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/Zoom.py new file mode 100644 index 00000000..af607177 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/Zoom.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithPresentation import Zoom + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Zoom('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/data/Zoom.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/data/Zoom.pptx new file mode 100644 index 00000000..c80f520f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithPresentation/Zoom/data/Zoom.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/AddingLineShape/AddingLineShape.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/AddingLineShape/AddingLineShape.py new file mode 100644 index 00000000..3b53d019 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/AddingLineShape/AddingLineShape.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import AddingLineShape + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AddingLineShape('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FillingShapes/FillingShapes.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FillingShapes/FillingShapes.py new file mode 100644 index 00000000..07b4f63e --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FillingShapes/FillingShapes.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import FillingShapes + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FillingShapes('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/FindShape.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/FindShape.py new file mode 100644 index 00000000..dfeaba59 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/FindShape.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import FindShape + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FindShape('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FindShape/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FormatLines/FormatLines.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FormatLines/FormatLines.py new file mode 100644 index 00000000..ddf16723 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/FormatLines/FormatLines.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import FormatLines + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FormatLines('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/Frame/Frame.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/Frame/Frame.py new file mode 100644 index 00000000..a5f633e0 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/Frame/Frame.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import Frame + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Frame('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/RotatingShapes/RotatingShapes.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/RotatingShapes/RotatingShapes.py new file mode 100644 index 00000000..078440ad --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithShapes/RotatingShapes/RotatingShapes.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import RotatingShapes + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = RotatingShapes('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/AccessSlides.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/AccessSlides.py new file mode 100644 index 00000000..078440ad --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/AccessSlides.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithShapes import RotatingShapes + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = RotatingShapes('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AccessSlides/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/AddSlides.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/AddSlides.py new file mode 100644 index 00000000..f08b3d86 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/AddSlides.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import AddSlides + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AddSlides('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/EmptySlide.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/EmptySlide.pptx new file mode 100644 index 00000000..d704a73e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/AddSlides/data/EmptySlide.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/Background.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/Background.py new file mode 100644 index 00000000..c0fc9afd --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/Background.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import Background + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Background('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/ContentBG.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/ContentBG.pptx new file mode 100644 index 00000000..6675dbff Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/ContentBG.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/MasterBG.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/MasterBG.pptx new file mode 100644 index 00000000..8f8d3ace Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Background/data/MasterBG.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/ChangingPosition.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/ChangingPosition.py new file mode 100644 index 00000000..1838194a --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/ChangingPosition.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import ChangingPosition + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ChangingPosition('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose_Position.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose_Position.pptx new file mode 100644 index 00000000..75598f9e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/ChangingPosition/data/Aspose_Position.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/CloneSlides.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/CloneSlides.py new file mode 100644 index 00000000..1830399d --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/CloneSlides.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import CloneSlides + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CloneSlides('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_Cloned.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_Cloned.pptx new file mode 100644 index 00000000..bac5aa3d Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_Cloned.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_dest2.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_dest2.pptx new file mode 100644 index 00000000..cc1152d8 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CloneSlides/data/Aspose_dest2.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/CreatingSvg.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/CreatingSvg.py new file mode 100644 index 00000000..498d0c2a --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/CreatingSvg.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import CreatingSvg + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CreatingSvg('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/SvgImage#i.svg b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/SvgImage#i.svg new file mode 100644 index 00000000..10fde5f6 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/CreatingSvg/data/SvgImage#i.svg @@ -0,0 +1,23 @@ + + + \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/Hyperlinks.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/Hyperlinks.py new file mode 100644 index 00000000..affbd77b --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/Hyperlinks.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import Hyperlinks + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Hyperlinks('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Hyperlinks.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Hyperlinks.pptx new file mode 100644 index 00000000..23f147b0 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Hyperlinks/data/Hyperlinks.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/RemoveSlides.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/RemoveSlides.py new file mode 100644 index 00000000..8e3d55e8 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/RemoveSlides.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import RemoveSlides + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = RemoveSlides('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Modified.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Modified.pptx new file mode 100644 index 00000000..a7393c65 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/RemoveSlides/data/Modified.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/SizeAndLayout.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/SizeAndLayout.py new file mode 100644 index 00000000..25a0c9a8 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/SizeAndLayout.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import SizeAndLayout + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = SizeAndLayout('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Slide_Size_Type.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Slide_Size_Type.pptx new file mode 100644 index 00000000..cd44a754 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/SizeAndLayout/data/Slide_Size_Type.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/Thumbnail.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/Thumbnail.py new file mode 100644 index 00000000..55e49653 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/Thumbnail.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import Thumbnail + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Thumbnail('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Thumbnail/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/Transitions.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/Transitions.py new file mode 100644 index 00000000..1ab8d167 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/Transitions.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSlidesInPresentation import Transitions + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = Transitions('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/Aspose.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/Aspose.pptx new file mode 100644 index 00000000..f48c0e61 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/Aspose.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/SimpleTransition.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/SimpleTransition.pptx new file mode 100644 index 00000000..88faf24f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSlidesInPresentation/Transitions/data/SimpleTransition.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/AddSmartArt.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/AddSmartArt.py new file mode 100644 index 00000000..e64cc05f --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/AddSmartArt.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSmartArt import AddSmartArt + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AddSmartArt('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/data/SimpleSmartArt.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/data/SimpleSmartArt.pptx new file mode 100644 index 00000000..f143ae79 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/AddSmartArt/data/SimpleSmartArt.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/FillFormat.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/FillFormat.py new file mode 100644 index 00000000..1b60ea8c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/FillFormat.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithSmartArt import FillFormat + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = FillFormat('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/data/FillFormat.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/data/FillFormat.pptx new file mode 100644 index 00000000..e76f2110 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithSmartArt/FillFormat/data/FillFormat.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AddImage/AddImage.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AddImage/AddImage.py new file mode 100644 index 00000000..734beaca --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AddImage/AddImage.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import AddImage + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AddImage('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AlignText/AlignText.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AlignText/AlignText.py new file mode 100644 index 00000000..0d2757e1 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/AlignText/AlignText.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import AlignText + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = AlignText('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/CloneRowColumn.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/CloneRowColumn.py new file mode 100644 index 00000000..8bba5a19 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/CloneRowColumn.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import CloneRowColumn + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CloneRowColumn('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/data/CloneRowColumn.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/data/CloneRowColumn.pptx new file mode 100644 index 00000000..964f407c Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CloneRowColumn/data/CloneRowColumn.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/CreateTable.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/CreateTable.py new file mode 100644 index 00000000..d7172cca --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/CreateTable.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import CreateTable + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CreateTable('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/data/CreateTable.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/data/CreateTable.pptx new file mode 100644 index 00000000..55dcb020 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/CreateTable/data/CreateTable.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/RemoveRowColumn.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/RemoveRowColumn.py new file mode 100644 index 00000000..36ab1c18 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/RemoveRowColumn.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithTables import RemoveRowColumn + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = RemoveRowColumn('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/data/RemoveRowColumn.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/data/RemoveRowColumn.pptx new file mode 100644 index 00000000..56b2e7fc Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithTables/RemoveRowColumn/data/RemoveRowColumn.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/CreateTextBox.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/CreateTextBox.py new file mode 100644 index 00000000..c4392df5 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/CreateTextBox.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import CreateTextBox + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = CreateTextBox('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/TextBox.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/TextBox.pptx new file mode 100644 index 00000000..f4a73c0e Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/TextBox.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/hLinkPPTX.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/hLinkPPTX.pptx new file mode 100644 index 00000000..9a904d06 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/CreateTextBox/data/hLinkPPTX.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/ManageText.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/ManageText.py new file mode 100644 index 00000000..aabe5991 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/ManageText.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import ManageText + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ManageText('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/AnchorText.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/AnchorText.pptx new file mode 100644 index 00000000..800f317c Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/AnchorText.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/VerticleText.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/VerticleText.pptx new file mode 100644 index 00000000..3e111f2f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/VerticleText.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/formatText.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/formatText.pptx new file mode 100644 index 00000000..af78a0a5 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ManageText/data/formatText.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/ReplaceText.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/ReplaceText.py new file mode 100644 index 00000000..e6d9128c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/ReplaceText.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import ReplaceText + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ReplaceText('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome.pptx new file mode 100644 index 00000000..de25cd13 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome_PH.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome_PH.pptx new file mode 100644 index 00000000..50d4c343 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ReplaceText/data/Welcome_PH.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/ShadowEffects.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/ShadowEffects.py new file mode 100644 index 00000000..aa276be8 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/ShadowEffects.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import ShadowEffects + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = ShadowEffects('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/data/OutShadow.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/data/OutShadow.pptx new file mode 100644 index 00000000..23f587e6 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/ShadowEffects/data/OutShadow.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/TextFont.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/TextFont.py new file mode 100644 index 00000000..58b42353 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/TextFont.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import TextFont + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = TextFont('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/FontFamilyOfText.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/FontFamilyOfText.pptx new file mode 100644 index 00000000..2c60002f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/FontFamilyOfText.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/Welcome.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/Welcome.pptx new file mode 100644 index 00000000..de25cd13 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/Welcome.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/WelcomeFont.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/WelcomeFont.pptx new file mode 100644 index 00000000..c8a9ce29 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/WelcomeFont.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/input.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/input.pptx new file mode 100644 index 00000000..426ae832 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/input.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/output.pdf b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/output.pdf new file mode 100644 index 00000000..64a9d52f Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/output.pdf differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/WordArt.py b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/WordArt.py new file mode 100644 index 00000000..defad6c4 --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/WordArt.py @@ -0,0 +1,13 @@ +__author__ = 'fahadadeel' +import jpype +import os.path +from WorkingWithText import WordArt + +asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") + +print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath + +jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s" % asposeapispath) + +testObject = WordArt('data/') +testObject.main() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/data/WordArt.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/data/WordArt.pptx new file mode 100644 index 00000000..b1042e79 Binary files /dev/null and b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/WordArt/data/WordArt.pptx differ diff --git a/Plugins/Aspose-Slides-Java-for-Python/untitled text 5.txt b/Plugins/Aspose-Slides-Java-for-Python/untitled text 5.txt new file mode 100644 index 00000000..31bcef1c --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/untitled text 5.txt @@ -0,0 +1,19 @@ +__author__ = 'fahadadeel' + +from setuptools import setup, find_packages + +setup( + name = 'aspose-slides-java-for-python', + packages = find_packages(), + version = '1.0', + description = 'Aspose.Slides Java for Python is a project that demonstrates / provides the Aspose.Slides for Java API usage examples in Python.', + author='Fahad Adeel', + author_email='slides@aspose.com', + url='http://www.aspose.com/docs/display/slidesjava/Aspose.Slides+Java+for+Python', + classifiers=[ + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent' + ] +) \ No newline at end of file