diff --git a/.gitignore b/.gitignore
index b105810c..69a809f2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,40 +1,41 @@
-# Eclipse project files
-.classpath
-.project
-.settings/
-test-output/
-
-# IntelliJ project files
-.idea/
-*.iws
-*.iml
-*.ipr
-
-# Mac
-.DS_Store
-
-# Others
-Temp/
-obj/
-classes/
-generated/
-bin/
-* Out*
-* out*
-*.ldb
-_ReSharper*/
-*.eml
-out/
-*.user
-*.resx
-nbproject/
-target/
-build/
-build.xml
-Thumbs.db
-manifest.mf
-Out/
-Out*/
-*.lic
-Data/*Out*
-/dist/
+# Eclipse project files
+.classpath
+.project
+.settings/
+test-output/
+
+# IntelliJ project files
+.idea/
+*.iws
+*.iml
+*.ipr
+
+# Mac
+.DS_Store
+
+# Others
+Temp/
+obj/
+classes/
+generated/
+bin/
+* Out*
+* out*
+*.ldb
+_ReSharper*/
+*.eml
+out/
+*.user
+*.resx
+nbproject/
+target/
+build/
+build.xml
+Thumbs.db
+manifest.mf
+Out/
+Out*/
+*.lic
+Data/*Out*
+/dist/
+/.vs
diff --git a/Examples/.project b/Examples/.project
deleted file mode 100644
index ee8166c2..00000000
--- a/Examples/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
+ Avis de la TEST TEST TEST TEST pour 2025 : 75 MDH (-12 MDH) +
+ ++ ➤ TEST 1 : 5 MDH +
++ ➤ Autres TEST : 56 MDH +
++ ➤ TESTTS : 1 785 MDH +
+ +
-
+
Aspose -Sample
\ No newline at end of file diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/importhtmltext/output.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/importhtmltext/output.pptx deleted file mode 100644 index b5d541c9..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/importhtmltext/output.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/input.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/input.pptx deleted file mode 100644 index 6bb9a12b..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/input.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.png b/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.png deleted file mode 100644 index 40d4df7f..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.png and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.xps b/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.xps deleted file mode 100644 index 3955781a..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/defaultfonts/output.xps and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontfamily/pptxFont.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/fontfamily/pptxFont.pptx deleted file mode 100644 index 4c0da3af..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontfamily/pptxFont.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/WelcomeFont.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/WelcomeFont.pptx deleted file mode 100644 index c9a682f2..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/WelcomeFont.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/welcome.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/welcome.pptx deleted file mode 100644 index 73ab0103..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/fontproperties/welcome.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/multipleparagraphs/multiParaPort.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/multipleparagraphs/multiParaPort.pptx deleted file mode 100644 index 4f12d5ea..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/multipleparagraphs/multiParaPort.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphbullets/Bullet.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphbullets/Bullet.pptx deleted file mode 100644 index d76a3f0e..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphbullets/Bullet.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphindent/InOutDent.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphindent/InOutDent.pptx deleted file mode 100644 index 0ba2a033..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphindent/InOutDent.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/Centeralign.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/Centeralign.pptx deleted file mode 100644 index e9b7924a..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/Centeralign.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/leftalign.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/leftalign.pptx deleted file mode 100644 index fcaebff6..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/paragraphsalignment/leftalign.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome.pptx deleted file mode 100644 index 73ab0103..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome_PH.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome_PH.pptx deleted file mode 100644 index 8d1212cc..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/replacingtext/welcome_PH.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/shadoweffects/pres.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/shadoweffects/pres.pptx deleted file mode 100644 index 16d2800c..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/shadoweffects/pres.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxhyperlink/hLinkPPTX.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxhyperlink/hLinkPPTX.pptx deleted file mode 100644 index 469b31d0..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxhyperlink/hLinkPPTX.pptx and /dev/null differ diff --git a/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxonslide/Textbox.pptx b/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxonslide/Textbox.pptx deleted file mode 100644 index dd5ac4b0..00000000 Binary files a/Examples/src/main/resources/com/aspose/slides/examples/Text/textboxonslide/Textbox.pptx and /dev/null differ diff --git a/Plugins/Aspose-Slides-Java-for-Jython/README.md b/Plugins/Aspose-Slides-Java-for-Jython/README.md index 2037b011..a16581a1 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/README.md +++ b/Plugins/Aspose-Slides-Java-for-Jython/README.md @@ -4,20 +4,11 @@ Aspose.Slides Java for Jython is a project that demonstrates / provides the Aspo ## 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/) +* To download Aspose.Slides for Java API to be used with these examples, Please navigate to [Aspose.Slides for Java](http://maven.aspose.com/repository/simple/ext-release-local/com/aspose/aspose-slides/) * Place downloaded jar file into "lib" directory. * Replace "your-lib" with the jar filename. ## Documentation -For most complete documentation of the project, check [Aspose.Slides Java For Jython confluence wiki](http://www.aspose.com/docs/display/slidesjava/Aspose.Slides+Java+for+Jython). +For most complete documentation of the project, check [Aspose.Slides Java For Jython confluence wiki](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+for+Jython). -## Download Latest Versions? - -* [Latest Releases on Codeplex](http://asposeslidesjavajython.codeplex.com/releasesce) - -## Clone Plugin SourceCodes? - -This project is also hosted and maintained at CodePlex. To clone navigate to: - -* [Aspose.Slides Java for Jython on CodePlex - click here](https://asposeslidesjavajython.codeplex.com/SourceControl/latest) diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/IntroductionToPresentation/HelloWorld.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/IntroductionToPresentation/HelloWorld.py index f2614d59..39bb07eb 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/IntroductionToPresentation/HelloWorld.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/IntroductionToPresentation/HelloWorld.py @@ -1,46 +1,46 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import SaveFormat -from java.awt import Color - -class HelloWorld: - - def __init__(self): - - dataDir = Settings.dataDir + 'IntroductionToPresentation/HelloWorld' - - # Instantiate Presentation - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shape_type = ShapeType - ashp = slide.getShapes().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 = FillType - color = 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 = SaveFormat - pres.save(dataDir + "HelloWorld.pptx", save_format.Pptx) - - print "Document has been saved, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import SaveFormat +from java.awt import Color + +class HelloWorld: + + def __init__(self): + + dataDir = Settings.dataDir + 'IntroductionToPresentation/HelloWorld' + + # Instantiate Presentation + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shape_type = ShapeType + ashp = slide.getShapes().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 = FillType + color = 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 = SaveFormat + pres.save(dataDir + "HelloWorld.pptx", save_format.Pptx) + + print "Document has been saved, please check the output file." + +if __name__ == '__main__': HelloWorld() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithActiveXControls/AddActiveX.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithActiveXControls/AddActiveX.py index bedda7e7..112dd2cf 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithActiveXControls/AddActiveX.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithActiveXControls/AddActiveX.py @@ -1,28 +1,28 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ControlType -from com.aspose.slides import SaveFormat - -class AddActiveX: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithActiveXControls/' - # Create an instance of Presentation class - pres = Presentation() - - # Adding the Media Player ActiveX control - controlType = ControlType - pres.getSlides().get_Item(0).getControls().addControl(controlType.WindowsMediaPlayer, 100, 100, 400, 400) - - # Access the Media Player ActiveX control and set the video path - pres.getSlides().get_Item(0).getControls().get_Item(0).getProperties().set_Item("URL" , dataDir + "Wildlife.mp4") - - # Write the presentation as a PPTX file - saveFormat = SaveFormat - pres.save(dataDir + "AddActiveX.pptx", saveFormat.Pptx) - - print "Added ActiveX control, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ControlType +from com.aspose.slides import SaveFormat + +class AddActiveX: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithActiveXControls/' + # Create an instance of Presentation class + pres = Presentation() + + # Adding the Media Player ActiveX control + controlType = ControlType + pres.getSlides().get_Item(0).getControls().addControl(controlType.WindowsMediaPlayer, 100, 100, 400, 400) + + # Access the Media Player ActiveX control and set the video path + pres.getSlides().get_Item(0).getControls().get_Item(0).getProperties().set_Item("URL" , dataDir + "Wildlife.mp4") + + # Write the presentation as a PPTX file + saveFormat = SaveFormat + pres.save(dataDir + "AddActiveX.pptx", saveFormat.Pptx) + + print "Added ActiveX control, please check the output file." + +if __name__ == '__main__': AddActiveX() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartLegend.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartLegend.py index 93a3a343..fee3f331 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartLegend.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartLegend.py @@ -1,46 +1,46 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import SaveFormat -from java.awt import Color - -class ChartLegend: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/' - - # Instantiate Presentation - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shape_type = ShapeType - ashp = slide.getShapes().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 = FillType - color = 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 = SaveFormat - pres.save(dataDir + "HelloWorld.pptx", save_format.Pptx) - - print "Document has been saved, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import SaveFormat +from java.awt import Color + +class ChartLegend: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/' + + # Instantiate Presentation + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shape_type = ShapeType + ashp = slide.getShapes().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 = FillType + color = 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 = SaveFormat + pres.save(dataDir + "HelloWorld.pptx", save_format.Pptx) + + print "Document has been saved, please check the output file." + +if __name__ == '__main__': ChartLegend() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartProperties.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartProperties.py index b3a4d422..966797d5 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartProperties.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartProperties.py @@ -1,128 +1,128 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat - -class ChartProperties: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ChartProperties' - - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - # Add chart with default data - charType=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 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 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 = SaveFormat - pres.save(dataDir + "3Drotation.pptx", save_format.Pptx) - - print "Done with rotation, please check the output file." - - def set_gapwidth(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ChartProperties' - - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - # Add chart with default data - charType=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 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 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 = SaveFormat - pres.save(dataDir + "SetGapWidth.pptx", save_format.Pptx) - - print "Set Gapwidth property of chart series, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat + +class ChartProperties: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ChartProperties' + + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + charType=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 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 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 = SaveFormat + pres.save(dataDir + "3Drotation.pptx", save_format.Pptx) + + print "Done with rotation, please check the output file." + + def set_gapwidth(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ChartProperties' + + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + charType=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 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 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 = SaveFormat + pres.save(dataDir + "SetGapWidth.pptx", save_format.Pptx) + + print "Set Gapwidth property of chart series, please check the output file." + +if __name__ == '__main__': ChartProperties() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartSeries.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartSeries.py index bc151f40..b16343fb 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartSeries.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartSeries.py @@ -1,37 +1,37 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat - -class ChartSeries: - - def __init__(self): - - # Adding Chart Series Overlap for Charts - self.add_overlap_for_chart() - - def add_overlap_for_chart(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ChartSeries' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Adding chart - chartType = 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 = SaveFormat - pres.save(dataDir + "Overlap.pptx", save_format.Pptx) - - print "Added chart series overlap for charts, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat + +class ChartSeries: + + def __init__(self): + + # Adding Chart Series Overlap for Charts + self.add_overlap_for_chart() + + def add_overlap_for_chart(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ChartSeries' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Adding chart + chartType = 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 = SaveFormat + pres.save(dataDir + "Overlap.pptx", save_format.Pptx) + + print "Added chart series overlap for charts, please check the output file." + +if __name__ == '__main__': ChartSeries() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartTrendLines.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartTrendLines.py index 3314ed07..e5912e54 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartTrendLines.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ChartTrendLines.py @@ -1,67 +1,67 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat -from com.aspose.slides import TrendlineType -from com.aspose.slides import FillType -from java.awt import Color - -class ChartTrendLines: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ChartTrendLines' - - # Creating empty presentation - pres =Presentation() - - # Creating a clustered column chart - chartType=ChartType - chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 400) - - # Adding ponential trend line for chart series 1 - trendlineType=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=FillType - color=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("New 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("New 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 = SaveFormat - pres.save(dataDir + "ChartTrendLines.pptx", save_format.Pptx) - - print "Done with chart trend lines, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat +from com.aspose.slides import TrendlineType +from com.aspose.slides import FillType +from java.awt import Color + +class ChartTrendLines: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ChartTrendLines' + + # Creating empty presentation + pres =Presentation() + + # Creating a clustered column chart + chartType=ChartType + chart = pres.getSlides().get_Item(0).getShapes().addChart(chartType.ClusteredColumn, 20, 20, 500, 400) + + # Adding ponential trend line for chart series 1 + trendlineType=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=FillType + color=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("New 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("New 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 = SaveFormat + pres.save(dataDir + "ChartTrendLines.pptx", save_format.Pptx) + + print "Done with chart trend lines, please check the output file." + +if __name__ == '__main__': ChartTrendLines() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/CreateChart.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/CreateChart.py index 00cd8d55..5f554b73 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/CreateChart.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/CreateChart.py @@ -1,194 +1,194 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import ChartType -from com.aspose.slides import LineDashStyle -from com.aspose.slides import LineArrowheadLength -from com.aspose.slides import LineArrowheadStyle -from com.aspose.slides import PresetColor -from com.aspose.slides import FillType -from com.aspose.slides import NullableBool -from com.aspose.slides import MarkerStyleType -from java.awt import color - -class CreateChart : - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/CreateChart' - - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - chartType=ChartType() - # Add chart with default data - chart = sld.getShapes().addChart(chartType.ClusteredColumn, 0, 0, 500, 500) - - nullableBool=NullableBool() - - # Setting chart Title - # chart.ChartTitle.TextFrameForOverriding.Text = "Sample 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() - s = chart.getChartData().getSeries().size() - s = chart.getChartData().getCategories().size() - - # Adding 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 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=FillType() - color=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 - - fillType1=FillType() - color1=Color() - - series.getFormat().getFill().setFillType(fillType1.Solid) - series.getFormat().getFill().getSolidFillColor().setColor(color1.GREEN) - - # create custom labels for each of categories for 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 - save_format = SaveFormat() - pres.save(dataDir + "NormalChart.pptx", save_format.Pptx) - - print "Created normal chart, please check the output file.".PHP_EOL - - def create_scatter_chart(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/CreateChart' - - pres = Presentation() - - slide = pres.getSlides().get_Item(0) - - chartType=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 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 point (1:3) there. - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 1), fact.getCell(defaultWorksheetIndex, 2, 2, 3)) - - # Add point (2:10) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 2), fact.getCell(defaultWorksheetIndex, 3, 2, 10)) - - # Edit the type of series - chartType=ChartType() - series.setType(chartType.ScatterWithStraightLinesAndMarkers) - - # Changing the chart series marker - - markerStyleType=MarkerStyleType() - series.getMarker().setSize(10) - series.getMarker().setSymbol(markerStyleType.Star) - - # Take second chart series - series = chart.getChartData().getSeries().get_Item(1) - - # Add point (5:2) there. - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 5), fact.getCell(defaultWorksheetIndex, 2, 4, 2)) - - # Add point (3:1) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 3), fact.getCell(defaultWorksheetIndex, 3, 4, 1)) - - # Add point (2:2) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 4, 3, 2), fact.getCell(defaultWorksheetIndex, 4, 4, 2)) - - # Add point (5:1) - series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 5, 3, 5), fact.getCell(defaultWorksheetIndex, 5, 4, 1)) - - # Changing the chart series marker - - markerStyleType1=MarkerStyleType() - - series.getMarker().setSize(10) - series.getMarker().setSymbol(markerStyleType1.Circle) - - save_format = SaveFormat() - pres.save(dataDir + "AsposeScatterChart.pptx", save_format.Pptx) - +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import ChartType +from com.aspose.slides import LineDashStyle +from com.aspose.slides import LineArrowheadLength +from com.aspose.slides import LineArrowheadStyle +from com.aspose.slides import PresetColor +from com.aspose.slides import FillType +from com.aspose.slides import NullableBool +from com.aspose.slides import MarkerStyleType +from java.awt import color + +class CreateChart : + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/CreateChart' + + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + chartType=ChartType() + # Add chart with default data + chart = sld.getShapes().addChart(chartType.ClusteredColumn, 0, 0, 500, 500) + + nullableBool=NullableBool() + + # Setting chart Title + # chart.ChartTitle.TextFrameForOverriding.Text = "Sample 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() + s = chart.getChartData().getSeries().size() + s = chart.getChartData().getCategories().size() + + # Adding 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 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=FillType() + color=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 + + fillType1=FillType() + color1=Color() + + series.getFormat().getFill().setFillType(fillType1.Solid) + series.getFormat().getFill().getSolidFillColor().setColor(color1.GREEN) + + # create custom labels for each of categories for 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 + save_format = SaveFormat() + pres.save(dataDir + "NormalChart.pptx", save_format.Pptx) + + print "Created normal chart, please check the output file.".PHP_EOL + + def create_scatter_chart(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/CreateChart' + + pres = Presentation() + + slide = pres.getSlides().get_Item(0) + + chartType=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 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 point (1:3) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 1), fact.getCell(defaultWorksheetIndex, 2, 2, 3)) + + # Add point (2:10) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 2), fact.getCell(defaultWorksheetIndex, 3, 2, 10)) + + # Edit the type of series + chartType=ChartType() + series.setType(chartType.ScatterWithStraightLinesAndMarkers) + + # Changing the chart series marker + + markerStyleType=MarkerStyleType() + series.getMarker().setSize(10) + series.getMarker().setSymbol(markerStyleType.Star) + + # Take second chart series + series = chart.getChartData().getSeries().get_Item(1) + + # Add point (5:2) there. + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 5), fact.getCell(defaultWorksheetIndex, 2, 4, 2)) + + # Add point (3:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 3), fact.getCell(defaultWorksheetIndex, 3, 4, 1)) + + # Add point (2:2) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 4, 3, 2), fact.getCell(defaultWorksheetIndex, 4, 4, 2)) + + # Add point (5:1) + series.getDataPoints().addDataPointForScatterSeries(fact.getCell(defaultWorksheetIndex, 5, 3, 5), fact.getCell(defaultWorksheetIndex, 5, 4, 1)) + + # Changing the chart series marker + + markerStyleType1=MarkerStyleType() + + series.getMarker().setSize(10) + series.getMarker().setSymbol(markerStyleType1.Circle) + + save_format = SaveFormat() + pres.save(dataDir + "AsposeScatterChart.pptx", save_format.Pptx) + print "Created scatter chart, please check the output file." \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ErrorBars.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ErrorBars.py index 0e74196a..3869064f 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ErrorBars.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ErrorBars.py @@ -1,101 +1,101 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat -from com.aspose.slides import ErrorBarValueType -from com.aspose.slides import ErrorBarType -from com.aspose.slides import DataSourceType - -class ErrorBars: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ErrorBars' - - pres = Presentation() - - # Creating a bubble chart - chartType=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() - - - errorBarValueType = ErrorBarValueType - errorBarType = 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 = SaveFormat - pres.save(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ErrorBars' - - pres = Presentation() - - slide = pres.getSlides().get_Item(0) - - # Creating a bubble chart - chartType = 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 = 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 = 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 = SaveFormat - pres.save(dataDir + "ErrorBarsCustomValues.pptx", save_format.Pptx) - - print "Added custom error bars values for chart, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat +from com.aspose.slides import ErrorBarValueType +from com.aspose.slides import ErrorBarType +from com.aspose.slides import DataSourceType + +class ErrorBars: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ErrorBars' + + pres = Presentation() + + # Creating a bubble chart + chartType=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() + + + errorBarValueType = ErrorBarValueType + errorBarType = 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 = SaveFormat + pres.save(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ErrorBars' + + pres = Presentation() + + slide = pres.getSlides().get_Item(0) + + # Creating a bubble chart + chartType = 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 = 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 = 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 = SaveFormat + pres.save(dataDir + "ErrorBarsCustomValues.pptx", save_format.Pptx) + + print "Added custom error bars values for chart, please check the output file." + +if __name__ == '__main__': ErrorBars() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ExistingChart.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ExistingChart.py index 38367c6c..8f56624d 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ExistingChart.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/ExistingChart.py @@ -1,73 +1,73 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat - -class ExistingChart: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/ExistingChart/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(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 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=ChartType - chart.setType(chartType.ClusteredCylinder) - - - # Saving the presentation to HTML format - save_format = SaveFormat - pres.save(dataDir + "AsposeChartModified.pptx", save_format.Pptx) - - print "Updated chart, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat + +class ExistingChart: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/ExistingChart/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(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 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=ChartType + chart.setType(chartType.ClusteredCylinder) + + + # Saving the presentation to HTML format + save_format = SaveFormat + pres.save(dataDir + "AsposeChartModified.pptx", save_format.Pptx) + + print "Updated chart, please check the output file." + +if __name__ == '__main__': ExistingChart() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/FormattingChartEntities.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/FormattingChartEntities.py index 6c0dc16b..ec7ec5f6 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/FormattingChartEntities.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/FormattingChartEntities.py @@ -1,195 +1,195 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat -from com.aspose.slides import FillType -from com.aspose.slides import NullableBool -from com.aspose.slides import LineDashStyle -from java.awt import Color -from com.aspose.slides import DisplayUnitType -from com.aspose.slides import FontData -from com.aspose.slides import PresetColor -from com.aspose.slides import TickLabelPositionType -from com.aspose.slides import LineStyle - -class FormattingChartEntities: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/FormattingChartEntities/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Accessing the first slide - slide = pres.getSlides().get_Item(0) - - # Adding the sample chart - chartType=ChartType - chart = slide.getShapes().addChart(chartType.LineWithMarkers, 50, 50, 500, 400) - - # Setting Chart Titile - chart.hasTitle() - chart.getChartTitle().addTextFrameForOverriding("") - chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) - chartTitle.setText("Sample Chart") - - fillType=FillType - color=Color - nullableBool=NullableBool - lineDashStyle=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=DisplayUnitType - chart.getAxes().getVerticalAxis().isNumberFormatLinkedToSource() - chart.getAxes().getVerticalAxis().setDisplayUnit(displayUnitType.Thousands) - chart.getAxes().getVerticalAxis().setNumberFormat("0.0%") - - # Setting chart maximum, minimum values - chart.getAxes().getVerticalAxis().isAutomaticMajorUnit() - chart.getAxes().getVerticalAxis().isAutomaticMaxValue() - chart.getAxes().getVerticalAxis().isAutomaticMinorUnit() - chart.getAxes().getVerticalAxis().isAutomaticMinValue() - - 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=FontData - presetColor=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(Color(presetColor.DarkGreen)) - txtVal.setLatinFont(FontData("Times New Roman")) - - # Setting value axis title - chart.getAxes().getVerticalAxis().hasTitle() - 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(FontData("Arial")) - - # Setting Category Titile - chart.getAxes().getHorizontalAxis().hasTitle() - 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 = 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(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 = LineStyle - chart.getAxes().getSecondaryVerticalAxis().isVisible() - 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() - displayUnitType=DisplayUnitType - chart.getAxes().getSecondaryVerticalAxis().setDisplayUnit(displayUnitType.Hundreds) - chart.getAxes().getSecondaryVerticalAxis().setNumberFormat ("0.0%") - - # Setting chart maximum, minimum values - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMajorUnit() - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMaxValue() - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinorUnit() - chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinValue() - - 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(Color(presetColor.LightCyan)) - - # Save Presentation - save_format = SaveFormat - pres.save(dataDir + "FormattedChart.pptx", save_format.Pptx) - - print "Formatted chart entities, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat +from com.aspose.slides import FillType +from com.aspose.slides import NullableBool +from com.aspose.slides import LineDashStyle +from java.awt import Color +from com.aspose.slides import DisplayUnitType +from com.aspose.slides import FontData +from com.aspose.slides import PresetColor +from com.aspose.slides import TickLabelPositionType +from com.aspose.slides import LineStyle + +class FormattingChartEntities: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/FormattingChartEntities/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Accessing the first slide + slide = pres.getSlides().get_Item(0) + + # Adding the sample chart + chartType=ChartType + chart = slide.getShapes().addChart(chartType.LineWithMarkers, 50, 50, 500, 400) + + # Setting Chart Titile + chart.hasTitle() + chart.getChartTitle().addTextFrameForOverriding("") + chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0) + chartTitle.setText("Sample Chart") + + fillType=FillType + color=Color + nullableBool=NullableBool + lineDashStyle=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=DisplayUnitType + chart.getAxes().getVerticalAxis().isNumberFormatLinkedToSource() + chart.getAxes().getVerticalAxis().setDisplayUnit(displayUnitType.Thousands) + chart.getAxes().getVerticalAxis().setNumberFormat("0.0%") + + # Setting chart maximum, minimum values + chart.getAxes().getVerticalAxis().isAutomaticMajorUnit() + chart.getAxes().getVerticalAxis().isAutomaticMaxValue() + chart.getAxes().getVerticalAxis().isAutomaticMinorUnit() + chart.getAxes().getVerticalAxis().isAutomaticMinValue() + + 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=FontData + presetColor=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(Color(presetColor.DarkGreen)) + txtVal.setLatinFont(FontData("Times New Roman")) + + # Setting value axis title + chart.getAxes().getVerticalAxis().hasTitle() + 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(FontData("Arial")) + + # Setting Category Titile + chart.getAxes().getHorizontalAxis().hasTitle() + 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 = 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(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 = LineStyle + chart.getAxes().getSecondaryVerticalAxis().isVisible() + 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() + displayUnitType=DisplayUnitType + chart.getAxes().getSecondaryVerticalAxis().setDisplayUnit(displayUnitType.Hundreds) + chart.getAxes().getSecondaryVerticalAxis().setNumberFormat ("0.0%") + + # Setting chart maximum, minimum values + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMajorUnit() + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMaxValue() + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinorUnit() + chart.getAxes().getSecondaryVerticalAxis().isAutomaticMinValue() + + 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(Color(presetColor.LightCyan)) + + # Save Presentation + save_format = SaveFormat + pres.save(dataDir + "FormattedChart.pptx", save_format.Pptx) + + print "Formatted chart entities, please check the output file." + +if __name__ == '__main__': FormattingChartEntities() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetLabelDistance.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetLabelDistance.py index ae3271e3..ce353c64 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetLabelDistance.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetLabelDistance.py @@ -1,32 +1,32 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat - -class SetLabelDistance: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/SetLabelDistance/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - # Adding a chart on slide - chartType=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 = SaveFormat - pres.save(dataDir + "Position.pptx", save_format.Pptx) - - print "Set label distance, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat + +class SetLabelDistance: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/SetLabelDistance/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Adding a chart on slide + chartType=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 = SaveFormat + pres.save(dataDir + "Position.pptx", save_format.Pptx) + + print "Set label distance, please check the output file." + +if __name__ == '__main__': SetLabelDistance() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetPieChartColors.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetPieChartColors.py index 875b5601..871a930b 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetPieChartColors.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithCharts/SetPieChartColors.py @@ -1,132 +1,132 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import ChartType -from com.aspose.slides import SaveFormat -from com.aspose.slides import NullableBool -from com.aspose.slides import FillType -from com.aspose.slides import LineStyle -from java.awt import Color -from com.aspose.slides import LineDashStyle -from com.aspose.slides import PresetColor - -class SetPieChartColors: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithCharts/SetPieChartColors/' - - pres = Presentation() - - # Access first slide - sld = pres.getSlides().get_Item(0) - - # Add chart with default data - chart_type = ChartType - chart = sld.getShapes().addChart(chart_type.Pie, 100, 100, 400, 400) - - nullableBool=NullableBool - - # Setting chart Title - chart.getChartTitle().addTextFrameForOverriding("Sample Title") - chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) - chart.getChartTitle().setHeight(20) - chart.hasTitle() - - # 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 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 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 version - # Adding points and setting sector color - chart.getChartData().getSeriesGroups().get_Item(0).isColorVaried() - - fill_type = FillType - line_style = LineStyle - color = Color - line_dash_style = LineDashStyle - preset_color = 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(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(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 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 = SaveFormat - pres.save(dataDir + "AsposePieChart.pptx", save_format.Pptx) - - print "Set pie chart sector colors, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import ChartType +from com.aspose.slides import SaveFormat +from com.aspose.slides import NullableBool +from com.aspose.slides import FillType +from com.aspose.slides import LineStyle +from java.awt import Color +from com.aspose.slides import LineDashStyle +from com.aspose.slides import PresetColor + +class SetPieChartColors: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithCharts/SetPieChartColors/' + + pres = Presentation() + + # Access first slide + sld = pres.getSlides().get_Item(0) + + # Add chart with default data + chart_type = ChartType + chart = sld.getShapes().addChart(chart_type.Pie, 100, 100, 400, 400) + + nullableBool=NullableBool + + # Setting chart Title + chart.getChartTitle().addTextFrameForOverriding("Sample Title") + chart.getChartTitle().getTextFrameForOverriding().getTextFrameFormat().setCenterText(nullableBool.True) + chart.getChartTitle().setHeight(20) + chart.hasTitle() + + # 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 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 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 version + # Adding points and setting sector color + chart.getChartData().getSeriesGroups().get_Item(0).isColorVaried() + + fill_type = FillType + line_style = LineStyle + color = Color + line_dash_style = LineDashStyle + preset_color = 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(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(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 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 = SaveFormat + pres.save(dataDir + "AsposePieChart.pptx", save_format.Pptx) + + print "Set pie chart sector colors, please check the output file." + +if __name__ == '__main__': SetPieChartColors() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToHtml.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToHtml.py index 2e9c0ab0..40a857bc 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToHtml.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToHtml.py @@ -1,30 +1,30 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import HtmlOptions -from com.aspose.slides import SaveFormat -from com.aspose.slides import HtmlFormatter - -class ConvertingToHtml: - - def __init__(self): - - self.convert_to_html() - - def convert_to_html(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToHtml/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - html_opt = HtmlOptions() - html_formatter = HtmlFormatter - html_opt.setHtmlFormatter(html_formatter.createDocumentFormatter("",False)) - - # Saving the presentation to HTML format - save_format = SaveFormat - pres.save(dataDir + "Aspose.html", save_format.Html, html_opt) - - print "Document has been converted, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import HtmlOptions +from com.aspose.slides import SaveFormat +from com.aspose.slides import HtmlFormatter + +class ConvertingToHtml: + + def __init__(self): + + self.convert_to_html() + + def convert_to_html(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToHtml/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + html_opt = HtmlOptions() + html_formatter = HtmlFormatter + html_opt.setHtmlFormatter(html_formatter.createDocumentFormatter("",False)) + + # Saving the presentation to HTML format + save_format = SaveFormat + pres.save(dataDir + "Aspose.html", save_format.Html, html_opt) + + print "Document has been converted, please check the output file." + +if __name__ == '__main__': ConvertingToHtml() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToNotes.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToNotes.py index 9192d8b6..968eeec2 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToNotes.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToNotes.py @@ -1,43 +1,43 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ConvertingToNotes: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToNotes/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Notes.tiff", save_format.TiffNotes) - - print "Document has been converted, please check the output file." - - def convert_to_pdf_notes(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToNotes/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Notes.pdf", save_format.pdf) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ConvertingToNotes: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToNotes/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Notes.tiff", save_format.TiffNotes) + + print "Document has been converted, please check the output file." + + def convert_to_pdf_notes(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToNotes/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Notes.pdf", save_format.pdf) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': ConvertingToNotes() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToPdf.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToPdf.py index 71231082..c87ee664 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToPdf.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToPdf.py @@ -1,22 +1,22 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ConvertingToPdf: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToPdf/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the PPTX presentation to Pdf format - save_format = SaveFormat - pres.save(dataDir + "Aspose.pdf", save_format.Pdf) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ConvertingToPdf: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToPdf/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to Pdf format + save_format = SaveFormat + pres.save(dataDir + "Aspose.pdf", save_format.Pdf) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': ConvertingToPdf() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToTiff.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToTiff.py index c26510a0..d0f65507 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToTiff.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToTiff.py @@ -1,62 +1,62 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import TiffOptions -from com.aspose.slides import TiffCompressionTypes -from java.awt import Dimension - -class ConvertingToTiff: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToTiff/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the PPTX presentation to Tiff format - save_format = SaveFormat - pres.save(dataDir + "Aspose.tiff", save_format.Tiff) - - print "Document has been converted, please check the output file." - - def convert_with_custom_size(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToTiff/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Instantiate the TiffOptions class - opts = TiffOptions - - # Setting compression type - tiff_compression_types = TiffCompressionTypes - opts.setCompressionType (tiff_compression_types.Default) - - #Setting image DPI - opts.setDpiX(200) - opts.setDpiY(100) - - # Set Image Size - opts.setImageSize(Dimension(1728, 1078)) - - # Save the presentation to TIFF with specified image size - save_format = SaveFormat - pres.save(dataDir + "Aspose-Custom-Size.tiff", save_format.Tiff,opts) - - print "Document has been converted, please check the output file." - - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import TiffOptions +from com.aspose.slides import TiffCompressionTypes +from java.awt import Dimension + +class ConvertingToTiff: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToTiff/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the PPTX presentation to Tiff format + save_format = SaveFormat + pres.save(dataDir + "Aspose.tiff", save_format.Tiff) + + print "Document has been converted, please check the output file." + + def convert_with_custom_size(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToTiff/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Instantiate the TiffOptions class + opts = TiffOptions + + # Setting compression type + tiff_compression_types = TiffCompressionTypes + opts.setCompressionType (tiff_compression_types.Default) + + #Setting image DPI + opts.setDpiX(200) + opts.setDpiY(100) + + # Set Image Size + opts.setImageSize(Dimension(1728, 1078)) + + # Save the presentation to TIFF with specified image size + save_format = SaveFormat + pres.save(dataDir + "Aspose-Custom-Size.tiff", save_format.Tiff,opts) + + print "Document has been converted, please check the output file." + + + +if __name__ == '__main__': ConvertingToTiff() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToXps.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToXps.py index 3636f4c4..9d576f73 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToXps.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/ConvertingToXps.py @@ -1,50 +1,50 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class ConvertingToXps: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToXps/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Saving the presentation to XPS format - save_format = SaveFormat - pres.save(dataDir + "Aspose.xps", save_format.Xps) - - print "Document has been converted, please check the output file." - - def convert_with_custom_size(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToXps/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Aspose.pptx") - - # Instantiate the TiffOptions class - opts = XpsOptions - - # Save MetaFiles as PNG - opts.SaveMetafilesAsPng = True - - # Save the presentation to TIFF with specified image size - save_format = SaveFormat - pres.save(dataDir + "Aspose-Custom-Size.xps", save_format.Xps, opts) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class ConvertingToXps: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToXps/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Saving the presentation to XPS format + save_format = SaveFormat + pres.save(dataDir + "Aspose.xps", save_format.Xps) + + print "Document has been converted, please check the output file." + + def convert_with_custom_size(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/ConvertingToXps/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Aspose.pptx") + + # Instantiate the TiffOptions class + opts = XpsOptions + + # Save MetaFiles as PNG + opts.SaveMetafilesAsPng = True + + # Save the presentation to TIFF with specified image size + save_format = SaveFormat + pres.save(dataDir + "Aspose-Custom-Size.xps", save_format.Xps, opts) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': ConvertingToXps() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/OdpToPptx.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/OdpToPptx.py index 97d40eae..24fed1d6 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/OdpToPptx.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/OdpToPptx.py @@ -1,24 +1,24 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class OdpToPptx: - - def __init__(self): - - - dataDir = Settings.dataDir + 'WorkingWithPresentation/OdpToPptx/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Source.odp") - - # Saving the PPTX presentation to PPTX format - save_format = SaveFormat - pres.save(dataDir + "Source.pptx", save_format.Pptx) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class OdpToPptx: + + def __init__(self): + + + dataDir = Settings.dataDir + 'WorkingWithPresentation/OdpToPptx/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Source.odp") + + # Saving the PPTX presentation to PPTX format + save_format = SaveFormat + pres.save(dataDir + "Source.pptx", save_format.Pptx) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': OdpToPptx() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/PptToPptx.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/PptToPptx.py index 6acdf201..1e423738 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/PptToPptx.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/PptToPptx.py @@ -1,24 +1,24 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class PptToPptx: - - def __init__(self): - - - dataDir = Settings.dataDir + 'WorkingWithPresentation/PptToPptx/' - - # Instantiate a Presentation object that represents a PPTX file - pres = Presentation(dataDir + "Presentation1.ppt") - - # Saving the PPTX presentation to PPTX format - save_format = SaveFormat - pres.save(dataDir + "Aspose.pptx", save_format.Pptx) - - print "Document has been converted, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class PptToPptx: + + def __init__(self): + + + dataDir = Settings.dataDir + 'WorkingWithPresentation/PptToPptx/' + + # Instantiate a Presentation object that represents a PPTX file + pres = Presentation(dataDir + "Presentation1.ppt") + + # Saving the PPTX presentation to PPTX format + save_format = SaveFormat + pres.save(dataDir + "Aspose.pptx", save_format.Pptx) + + print "Document has been converted, please check the output file." + + +if __name__ == '__main__': PptToPptx() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Properties.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Properties.py index 85610081..29613a34 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Properties.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Properties.py @@ -1,124 +1,124 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class Properties: - - def __init__(self): - - - # Accessing Built-in Properties - 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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' - - # Instantiate the Presentation class that represents the presentation - pres = Presentation(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 : " - 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 : " - dp.getLastSavedTime() - print "Presentation Format : " - dp.getPresentationFormat() - print "Last Print Date : " - dp.getLastPrinted() - print "Is Shared between producers : " - dp.getSharedDoc() - print "Subject : " - dp.getSubject() - print "Title : " - dp.getTitle() - - def update_properties(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' - - # Instantiate the Presentation class that represents the presentation - pres = Presentation(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 = SaveFormat - pres.save(dataDir + "DocProps.pptx", save_format.Pptx) - - print "Properties have been updated, Please check output file." - - def add_custom_properties(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' - - #Instantiate the Presentation class that represents the presentation - pres = Presentation(dataDir + "HelloWorld.pptx") - - # Getting Document Properties - dp = pres.getDocumentProperties() - - # Adding Custom properties - dp.set_Item("New Custom" , 12) - dp.set_Item("My Name","Mudassir") - dp.set_Item("Custom", 124) - - # Saving presentation - save_format = SaveFormat - pres.save(dataDir + "CustomDemo.pptx", save_format.Pptx) - - print "Added custom properties, please check output file." - - - def remove_property(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' - - # Instantiate the Presentation class that represents the presentation - pres = Presentation(dataDir + "HelloWorld.pptx") - - # Getting Document Properties - dp = pres.getDocumentProperties() - - # Getting property name at particular index - property_name = dp.getPropertyName(2) - - # Removing selected property - dp.remove(property_name) - - # Saving presentation - save_format = SaveFormat - pres.save(dataDir + "RemoveDP.pptx", save_format.Pptx) - - print "Remove document property, please check output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class Properties: + + def __init__(self): + + + # Accessing Built-in Properties + 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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' + + # Instantiate the Presentation class that represents the presentation + pres = Presentation(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 : " + 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 : " + dp.getLastSavedTime() + print "Presentation Format : " + dp.getPresentationFormat() + print "Last Print Date : " + dp.getLastPrinted() + print "Is Shared between producers : " + dp.getSharedDoc() + print "Subject : " + dp.getSubject() + print "Title : " + dp.getTitle() + + def update_properties(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' + + # Instantiate the Presentation class that represents the presentation + pres = Presentation(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 = SaveFormat + pres.save(dataDir + "DocProps.pptx", save_format.Pptx) + + print "Properties have been updated, Please check output file." + + def add_custom_properties(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' + + #Instantiate the Presentation class that represents the presentation + pres = Presentation(dataDir + "HelloWorld.pptx") + + # Getting Document Properties + dp = pres.getDocumentProperties() + + # Adding Custom properties + dp.set_Item("New Custom" , 12) + dp.set_Item("My Name","Mudassir") + dp.set_Item("Custom", 124) + + # Saving presentation + save_format = SaveFormat + pres.save(dataDir + "CustomDemo.pptx", save_format.Pptx) + + print "Added custom properties, please check output file." + + + def remove_property(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/' + + # Instantiate the Presentation class that represents the presentation + pres = Presentation(dataDir + "HelloWorld.pptx") + + # Getting Document Properties + dp = pres.getDocumentProperties() + + # Getting property name at particular index + property_name = dp.getPropertyName(2) + + # Removing selected property + dp.remove(property_name) + + # Saving presentation + save_format = SaveFormat + pres.save(dataDir + "RemoveDP.pptx", save_format.Pptx) + + print "Remove document property, please check output file." + +if __name__ == '__main__': Properties() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Zoom.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Zoom.py index fdfa8c11..8f751c06 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Zoom.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithPresentation/Zoom.py @@ -1,26 +1,26 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class Zoom: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithPresentation/Zoom/' - - # Create an instance of Presentation class - pres = Presentation() - - # Setting View Properties of Presentation - pres.getViewProperties().getSlideViewProperties().setScale(50) # zoom value in percentages for slide view - pres.getViewProperties().getNotesViewProperties().setScale(50) # .Scale = 50 //zoom value in percentages for notes view - - # Save the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "Zoom.pptx", save_format.Pptx) - - print "Set zoom value, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class Zoom: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithPresentation/Zoom/' + + # Create an instance of Presentation class + pres = Presentation() + + # Setting View Properties of Presentation + pres.getViewProperties().getSlideViewProperties().setScale(50) # zoom value in percentages for slide view + pres.getViewProperties().getNotesViewProperties().setScale(50) # .Scale = 50 //zoom value in percentages for notes view + + # Save the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "Zoom.pptx", save_format.Pptx) + + print "Set zoom value, please check the output file." + +if __name__ == '__main__': Zoom() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/AddingLineShape.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/AddingLineShape.py index 671123b5..efafe8f4 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/AddingLineShape.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/AddingLineShape.py @@ -1,88 +1,88 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import LineStyle -from com.aspose.slides import LineDashStyle -from com.aspose.slides import LineArrowheadLength -from com.aspose.slides import LineArrowheadStyle -from com.aspose.slides import PresetColor -from com.aspose.slides import FillType -from java.awt import Color - -class AddingLineShape: - - def __init__(self): - - # Adding Plain Line to Slide - self.add_plain_line() - - # Adding Arrow Shaped Line to Slide - self.add_arrow_line() - - def add_plain_line(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/AddingLineShape/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add an autoshape of type line - shapeType = ShapeType - sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "LineShape.pptx", save_format.Pptx) - - print "Added plain line to slide, please check the output file." - - def add_arrow_line(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/AddingLineShape/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add an autoshape of type line - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) - - # Apply some formatting on the line - lineStyle = LineStyle - shp.getLineFormat().setStyle(lineStyle.ThickBetweenThin) - shp.getLineFormat().setWidth(10) - - lineDashStyle = LineDashStyle - shp.getLineFormat().setDashStyle(lineDashStyle.DashDot) - - lineArrowheadLength = LineArrowheadLength - lineArrowheadStyle = LineArrowheadStyle - fillType = FillType - color = Color - presetColor = 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(Color(presetColor.Maroon)) - - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "ArrowShape.pptx", save_format.Pptx) - - print "Added arrow shape line to slide, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import LineStyle +from com.aspose.slides import LineDashStyle +from com.aspose.slides import LineArrowheadLength +from com.aspose.slides import LineArrowheadStyle +from com.aspose.slides import PresetColor +from com.aspose.slides import FillType +from java.awt import Color + +class AddingLineShape: + + def __init__(self): + + # Adding Plain Line to Slide + self.add_plain_line() + + # Adding Arrow Shaped Line to Slide + self.add_arrow_line() + + def add_plain_line(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/AddingLineShape/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an autoshape of type line + shapeType = ShapeType + sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "LineShape.pptx", save_format.Pptx) + + print "Added plain line to slide, please check the output file." + + def add_arrow_line(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/AddingLineShape/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an autoshape of type line + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Line, 50, 150, 300, 0) + + # Apply some formatting on the line + lineStyle = LineStyle + shp.getLineFormat().setStyle(lineStyle.ThickBetweenThin) + shp.getLineFormat().setWidth(10) + + lineDashStyle = LineDashStyle + shp.getLineFormat().setDashStyle(lineDashStyle.DashDot) + + lineArrowheadLength = LineArrowheadLength + lineArrowheadStyle = LineArrowheadStyle + fillType = FillType + color = Color + presetColor = 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(Color(presetColor.Maroon)) + + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "ArrowShape.pptx", save_format.Pptx) + + print "Added arrow shape line to slide, please check the output file." + +if __name__ == '__main__': AddingLineShape() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FillingShapes.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FillingShapes.py index 7fa18c60..39807cde 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FillingShapes.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FillingShapes.py @@ -1,121 +1,121 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import PatternStyle -from com.aspose.slides import PictureFillMode -from java.awt import Color -from java.io import File -from java.io import FileInputStream - -class FillingShapes: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) - - # Set the fill type to Pattern - fillType = FillType - shp.getFillFormat().setFillType(fillType.Pattern) - - # Set the pattern style - patternStyle = PatternStyle - shp.getFillFormat().getPatternFormat().setPatternStyle(patternStyle.Trellis) - - # Set the pattern back and fore colors - color = 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 = SaveFormat - pres.save(dataDir + "RectShpPatt.pptx", save_format.Pptx) - - print "Filled shapes with Pattern, please check the output file." - - def fill_shapes_with_picture(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) - - # Set the fill type to Picture - fillType = FillType - shp.getFillFormat().setFillType(fillType.Picture) - - # Set the picture fill mode - pictureFillMode = PictureFillMode - shp.getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Tile) - - # Set the picture - imgx = pres.getImages().addImage(FileInputStream(File(dataDir + "night.jpg"))) - - shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectShpPic.pptx", save_format.Pptx) - - print "Filled shapes with Picture, please check the output file." - - - def fill_shapes_with_solid_color(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) - - # Set the fill type to Solid - fillType = FillType - shp.getFillFormat().setFillType(fillType.Solid) - - # Set the color of the rectangle - color = Color - shp.getFillFormat().getSolidFillColor().setColor(color.YELLOW) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectShpSolid.pptx", save_format.Pptx) - - print "Filled shapes with Solid Color, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import PatternStyle +from com.aspose.slides import PictureFillMode +from java.awt import Color +from java.io import File +from java.io import FileInputStream + +class FillingShapes: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Pattern + fillType = FillType + shp.getFillFormat().setFillType(fillType.Pattern) + + # Set the pattern style + patternStyle = PatternStyle + shp.getFillFormat().getPatternFormat().setPatternStyle(patternStyle.Trellis) + + # Set the pattern back and fore colors + color = 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 = SaveFormat + pres.save(dataDir + "RectShpPatt.pptx", save_format.Pptx) + + print "Filled shapes with Pattern, please check the output file." + + def fill_shapes_with_picture(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Picture + fillType = FillType + shp.getFillFormat().setFillType(fillType.Picture) + + # Set the picture fill mode + pictureFillMode = PictureFillMode + shp.getFillFormat().getPictureFillFormat().setPictureFillMode(pictureFillMode.Tile) + + # Set the picture + imgx = pres.getImages().addImage(FileInputStream(File(dataDir + "night.jpg"))) + + shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectShpPic.pptx", save_format.Pptx) + + print "Filled shapes with Picture, please check the output file." + + + def fill_shapes_with_solid_color(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FillingShapes/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill type to Solid + fillType = FillType + shp.getFillFormat().setFillType(fillType.Solid) + + # Set the color of the rectangle + color = Color + shp.getFillFormat().getSolidFillColor().setColor(color.YELLOW) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectShpSolid.pptx", save_format.Pptx) + + print "Filled shapes with Solid Color, please check the output file." + +if __name__ == '__main__': FillingShapes() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FindShape.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FindShape.py index 0377c897..c6bb5d95 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FindShape.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FindShape.py @@ -1,40 +1,40 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import XpsOptions - -class FindShape: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FindShape/' - - # Create an instance of Presentation class - pres = Presentation(dataDir + 'demo.pptx') - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - shape = self.find_shape(slide) - - print "Shape: " . shape - - def find_shape(slide, alttext): - - #Iterating through all shapes inside the slide - - i = 0 - slide_size = slide.getShapes().size() - - while i < slide_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 nil - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import XpsOptions + +class FindShape: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FindShape/' + + # Create an instance of Presentation class + pres = Presentation(dataDir + 'demo.pptx') + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + shape = self.find_shape(slide) + + print "Shape: " . shape + + def find_shape(slide, alttext): + + #Iterating through all shapes inside the slide + + i = 0 + slide_size = slide.getShapes().size() + + while i < slide_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 nil + + +if __name__ == '__main__': FindShape() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FormatLines.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FormatLines.py index 971f76d7..fe2ff780 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FormatLines.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/FormatLines.py @@ -1,118 +1,118 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import LineStyle -from com.aspose.slides import LineDashStyle -from com.aspose.slides import LineJoinStyle - -from java.awt import Color - -class FormatLines: - - def __init__(self): - - # Formatting the Lines of Shapes - self.format_lines() - - # Formatting the Join Styles - self.format_join_styles() - - def format_lines(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FormatLines/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = ShapeType - shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) - - # Set the fill color of the rectangle shape - fillType = FillType - color = Color - shp.getFillFormat().setFillType(fillType.Solid) - shp.getFillFormat().getSolidFillColor().setColor(color.WHITE) - - # Apply some formatting on the line of the rectangle - - lineStyle = LineStyle - shp.getLineFormat().setStyle(lineStyle.ThickThin) - shp.getLineFormat().setWidth(7) - - lineDashStyle = 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 = SaveFormat - pres.save(dataDir + "RectShpLn.pptx", save_format.Pptx) - - print "Formatted lines, please check the output file." - - def format_join_styles(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/FormatLines/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add three autoshapes of rectangle type - shape_type = 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 = FillType - color = 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 = 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 = SaveFormat - pres.save(dataDir + "RectShpLnJoin.pptx", save_format.Pptx) - - print "Formatted join styles, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import LineStyle +from com.aspose.slides import LineDashStyle +from com.aspose.slides import LineJoinStyle + +from java.awt import Color + +class FormatLines: + + def __init__(self): + + # Formatting the Lines of Shapes + self.format_lines() + + # Formatting the Join Styles + self.format_join_styles() + + def format_lines(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FormatLines/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = ShapeType + shp = sld.getShapes().addAutoShape(shapeType.Rectangle, 50, 150, 75, 150) + + # Set the fill color of the rectangle shape + fillType = FillType + color = Color + shp.getFillFormat().setFillType(fillType.Solid) + shp.getFillFormat().getSolidFillColor().setColor(color.WHITE) + + # Apply some formatting on the line of the rectangle + + lineStyle = LineStyle + shp.getLineFormat().setStyle(lineStyle.ThickThin) + shp.getLineFormat().setWidth(7) + + lineDashStyle = 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 = SaveFormat + pres.save(dataDir + "RectShpLn.pptx", save_format.Pptx) + + print "Formatted lines, please check the output file." + + def format_join_styles(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/FormatLines/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add three autoshapes of rectangle type + shape_type = 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 = FillType + color = 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 = 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 = SaveFormat + pres.save(dataDir + "RectShpLnJoin.pptx", save_format.Pptx) + + print "Formatted join styles, please check the output file." + +if __name__ == '__main__': FormatLines() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/Frame.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/Frame.py index 3c6b7461..0e1efe28 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/Frame.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/Frame.py @@ -1,106 +1,106 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import AudioPlayModePreset -from com.aspose.slides import AudioVolumeMode -from com.aspose.slides import VideoPlayModePreset - -from java.io import FileInputStream -from java.io import File - -class Frame: - - def __init__(self): - - # Formatting the Lines of Shapes - self.add_picture_frame() - - # Formatting the Join Styles - self.add_audio_frame() - - # Adding Audio Frame to Slide - self.add_audio_frame() - - self.add_video_frame() - - def add_picture_frame(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sId = pres.getSlides().get_Item(0) - - # Instantiate the Image class - imgx = pres.getImages().addImage(FileInputStream(File(dataDir + "aspose-logo.jpg"))) - - # Add Picture Frame with height and width equivalent of Picture - shapeType = ShapeType - sId.getShapes().addPictureFrame(shapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "RectPicFrame.pptx", save_format.Pptx) - - print "Added picture frame to slide, please check the output file." - - def add_audio_frame(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sId = pres.getSlides().get_Item(0) - - # Load the wav sound file to stram - fstr = FileInputStream(File(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 = AudioPlayModePreset - audioVolumeMode = AudioVolumeMode - af.setPlayMode(audioPlayModePreset.Auto) - af.setVolume(audioVolumeMode.Loud) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "AudioFrameEmbed.pptx", save_format.Pptx) - - print "Added audio frame to slide, please check the output file." - - def add_video_frame(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sId = pres.getSlides().get_Item(0) - - # Add Video Frame - vf = sId.getShapes().addVideoFrame(50, 150, 300, 150, dataDir + "Wildlife.mp4") - - # Set Play Mode and Volume of the Video - videoPlayModePreset = VideoPlayModePreset - audioVolumeMode = AudioVolumeMode - - vf.setPlayMode(videoPlayModePreset.Auto) - vf.setVolume(audioVolumeMode.Loud) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "VideoFrame.pptx", save_format.Pptx) - - print "Added video frame to slide, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import AudioPlayModePreset +from com.aspose.slides import AudioVolumeMode +from com.aspose.slides import VideoPlayModePreset + +from java.io import FileInputStream +from java.io import File + +class Frame: + + def __init__(self): + + # Formatting the Lines of Shapes + self.add_picture_frame() + + # Formatting the Join Styles + self.add_audio_frame() + + # Adding Audio Frame to Slide + self.add_audio_frame() + + self.add_video_frame() + + def add_picture_frame(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Instantiate the Image class + imgx = pres.getImages().addImage(FileInputStream(File(dataDir + "aspose-logo.jpg"))) + + # Add Picture Frame with height and width equivalent of Picture + shapeType = ShapeType + sId.getShapes().addPictureFrame(shapeType.Rectangle, 50, 150, imgx.getWidth(), imgx.getHeight(), imgx) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "RectPicFrame.pptx", save_format.Pptx) + + print "Added picture frame to slide, please check the output file." + + def add_audio_frame(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Load the wav sound file to stram + fstr = FileInputStream(File(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 = AudioPlayModePreset + audioVolumeMode = AudioVolumeMode + af.setPlayMode(audioPlayModePreset.Auto) + af.setVolume(audioVolumeMode.Loud) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "AudioFrameEmbed.pptx", save_format.Pptx) + + print "Added audio frame to slide, please check the output file." + + def add_video_frame(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithShapes/Frame/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sId = pres.getSlides().get_Item(0) + + # Add Video Frame + vf = sId.getShapes().addVideoFrame(50, 150, 300, 150, dataDir + "Wildlife.mp4") + + # Set Play Mode and Volume of the Video + videoPlayModePreset = VideoPlayModePreset + audioVolumeMode = AudioVolumeMode + + vf.setPlayMode(videoPlayModePreset.Auto) + vf.setVolume(audioVolumeMode.Loud) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "VideoFrame.pptx", save_format.Pptx) + + print "Added video frame to slide, please check the output file." + + +if __name__ == '__main__': Frame() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/RotatingShapes.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/RotatingShapes.py index 13d0cd40..5942bb6f 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/RotatingShapes.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithShapes/RotatingShapes.py @@ -1,33 +1,33 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType - - -class RotatingShapes: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithShapes/RotatingShapes/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType = 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 = SaveFormat - pres.save(dataDir + "RectShpRot.pptx", save_format.Pptx) - - print "Rotated shape, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType + + +class RotatingShapes: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithShapes/RotatingShapes/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType = 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 = SaveFormat + pres.save(dataDir + "RectShpRot.pptx", save_format.Pptx) + + print "Rotated shape, please check the output file." + +if __name__ == '__main__': RotatingShapes() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AccessSlides.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AccessSlides.py index 83d26fef..c1ad0fda 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AccessSlides.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AccessSlides.py @@ -1,45 +1,45 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class AccessSlides: - - def __init__(self): - - # Formatting the Lines of Shapes - self.get_slide_by_index() - - # Formatting the Join Styles - self.get_slide_by_id() - - def get_slide_by_index(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AccessSlides/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Accessing a slide using its slide index - slide = pres.getSlides().get_Item(0) - - print "Slide: " - print slide - - def get_slide_by_id(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AccessSlides/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Getting Slide ID - id = pres.getSlides().get_Item(0).getSlideId() - - # Accessing Slide by ID - slide = pres.getSlideById(id) - - print "Slide: " - print slide - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class AccessSlides: + + def __init__(self): + + # Formatting the Lines of Shapes + self.get_slide_by_index() + + # Formatting the Join Styles + self.get_slide_by_id() + + def get_slide_by_index(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AccessSlides/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Accessing a slide using its slide index + slide = pres.getSlides().get_Item(0) + + print "Slide: " + print slide + + def get_slide_by_id(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AccessSlides/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Getting Slide ID + id = pres.getSlides().get_Item(0).getSlideId() + + # Accessing Slide by ID + slide = pres.getSlideById(id) + + print "Slide: " + print slide + +if __name__ == '__main__': AccessSlides() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AddSlides.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AddSlides.py index 73c35dcd..2ea278bf 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AddSlides.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/AddSlides.py @@ -1,35 +1,35 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class AddSlides: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AddSlides/' - - # Instantiate Presentation class that represents the presentation file - pres =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 = SaveFormat - pres.save(dataDir + "EmptySlide.pptx", save_format.Pptx) - - print "Document has been created, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class AddSlides: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/AddSlides/' + + # Instantiate Presentation class that represents the presentation file + pres =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 = SaveFormat + pres.save(dataDir + "EmptySlide.pptx", save_format.Pptx) + + print "Document has been created, please check the output file." + +if __name__ == '__main__': AddSlides() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Background.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Background.py index c588a854..2632182c 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Background.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Background.py @@ -1,103 +1,103 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import BackgroundType -from com.aspose.slides import FillType -from com.aspose.slides import PictureFillMode -from java.awt import Color -from java.io import File -from java.io import FileInputStream - - -class Background: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Set the background color of the Master Slide to Forest Green - backgroundType = BackgroundType - fillType = FillType - color = 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 = SaveFormat - pres.save(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Set the background color of the Normal slide to Blue - - backgroundType = BackgroundType - fillType = FillType - color = 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 = SaveFormat - pres.save(dataDir + "ContentBG.pptx", save_format.Pptx) - - print "Set background color of normal slide, please check the output file." - - def set_image_as_background_color(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Set the background with Image - - backgroundType = BackgroundType - fillType = FillType - pictureFillMode = 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(FileInputStream(File(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 = SaveFormat - pres.save(dataDir + "ContentBG_Image.pptx", save_format.Pptx) - - print "Set image as background, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import BackgroundType +from com.aspose.slides import FillType +from com.aspose.slides import PictureFillMode +from java.awt import Color +from java.io import File +from java.io import FileInputStream + + +class Background: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Set the background color of the Master Slide to Forest Green + backgroundType = BackgroundType + fillType = FillType + color = 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 = SaveFormat + pres.save(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Set the background color of the Normal slide to Blue + + backgroundType = BackgroundType + fillType = FillType + color = 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 = SaveFormat + pres.save(dataDir + "ContentBG.pptx", save_format.Pptx) + + print "Set background color of normal slide, please check the output file." + + def set_image_as_background_color(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Background/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Set the background with Image + + backgroundType = BackgroundType + fillType = FillType + pictureFillMode = 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(FileInputStream(File(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 = SaveFormat + pres.save(dataDir + "ContentBG_Image.pptx", save_format.Pptx) + + print "Set image as background, please check the output file." + + +if __name__ == '__main__': Background() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/ChangingPosition.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/ChangingPosition.py index 5bc77f43..3b778af8 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/ChangingPosition.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/ChangingPosition.py @@ -1,27 +1,27 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ChangingPosition: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Get the slide whose position is to be changed - slide = pres.getSlides().get_Item(0) - - # Set the position for the slide - slide.setSlideNumber(2) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Aspose_Position.pptx", save_format.Pptx) - - print "Changes slide position, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ChangingPosition: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Get the slide whose position is to be changed + slide = pres.getSlides().get_Item(0) + + # Set the position for the slide + slide.setSlideNumber(2) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Aspose_Position.pptx", save_format.Pptx) + + print "Changes slide position, please check the output file." + +if __name__ == '__main__': ChangingPosition() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CloneSlides.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CloneSlides.py index a94cfccc..f678c836 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CloneSlides.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CloneSlides.py @@ -1,77 +1,77 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ChangingPosition: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' - - # Instantiate Presentation class that represents the presentation file - - pres = Presentation(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 = SaveFormat - pres.save(dataDir + "Aspose_Cloned.pptx", save_format.Pptx) - - print "Slide has been cloned, please check the output file." - - def clone_to_aonther_position(dataDir): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(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(2, pres.getSlides().get_Item(1)) - - # Saving the presentation file - save_format = SaveFormat - pres.save(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(dataDir): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' - - # Instantiate Presentation class that represents the presentation file - src_pres = Presentation(dataDir + 'Aspose.pptx') - - # Instantiate Presentation class for destination PPTX (where slide is to be cloned) - dest_pres = 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 = SaveFormat - dest_pres.save(dataDir + "Aspose_dest2.pptx", save_format.Pptx) - - print "Slide has been cloned, please check the output file." - - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ChangingPosition: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' + + # Instantiate Presentation class that represents the presentation file + + pres = Presentation(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 = SaveFormat + pres.save(dataDir + "Aspose_Cloned.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + + def clone_to_aonther_position(dataDir): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(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(2, pres.getSlides().get_Item(1)) + + # Saving the presentation file + save_format = SaveFormat + pres.save(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(dataDir): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/ChangingPosition/' + + # Instantiate Presentation class that represents the presentation file + src_pres = Presentation(dataDir + 'Aspose.pptx') + + # Instantiate Presentation class for destination PPTX (where slide is to be cloned) + dest_pres = 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 = SaveFormat + dest_pres.save(dataDir + "Aspose_dest2.pptx", save_format.Pptx) + + print "Slide has been cloned, please check the output file." + + + +if __name__ == '__main__': ChangingPosition() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CreatingSvg.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CreatingSvg.py index b98d2519..eba02df7 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CreatingSvg.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CreatingSvg.py @@ -1,33 +1,33 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from java.io import FileOutputStream - -class CreatingSvg: - - def __init__(self): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/CreatingSvg/' - - ## Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.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(FileOutputStream(dataDir + "SvgImage#{i}.svg")) - - i+=1 - - print "Created SVG images, please check output files." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from java.io import FileOutputStream + +class CreatingSvg: + + def __init__(self): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/CreatingSvg/' + + ## Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.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(FileOutputStream(dataDir + "SvgImage#{i}.svg")) + + i+=1 + + print "Created SVG images, please check output files." + + +if __name__ == '__main__': CreatingSvg() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Hyperlinks.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Hyperlinks.py index 4c8e2bcf..d84c3b6e 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Hyperlinks.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Hyperlinks.py @@ -1,23 +1,23 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class Hyperlinks: - - def __init__(self): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Hyperlinks/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - - # Removing the hyperlinks from presentation - pres.getHyperlinkQueries().removeAllHyperlinks() - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Hyperlinks.pptx", save_format.Pptx) - - print "Removed hyperlinks successfully, please check the output file." - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class Hyperlinks: + + def __init__(self): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Hyperlinks/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + + # Removing the hyperlinks from presentation + pres.getHyperlinkQueries().removeAllHyperlinks() + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Hyperlinks.pptx", save_format.Pptx) + + print "Removed hyperlinks successfully, please check the output file." + +if __name__ == '__main__': Hyperlinks() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/RemoveSlides.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/RemoveSlides.py index e2078007..885c5264 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/RemoveSlides.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/RemoveSlides.py @@ -1,52 +1,52 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from java.io import FileOutputStream - -class RemoveSlides: - - def __init__(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(dataDir): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/RemoveSlides/' - # Instantiate Presentation class that represents the presentation file - pres = Presentation(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 = SaveFormat - pres.save(dataDir + "Modified.pptx", save_format.Pptx) - - print "Removed slide by Index, please check the output file." - - def remove_slide_by_id(dataDir): - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/RemoveSlides/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'Aspose.pptx') - - # Removing a slide using its slide index - pres.getSlides().removeAt(1) - - # Saving the presentation file - save_format = SaveFormat - pres.save(dataDir + "Modified.pptx", save_format.Pptx) - - print "Removed slide by ID, please check the output file." - - - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from java.io import FileOutputStream + +class RemoveSlides: + + def __init__(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(dataDir): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/RemoveSlides/' + # Instantiate Presentation class that represents the presentation file + pres = Presentation(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 = SaveFormat + pres.save(dataDir + "Modified.pptx", save_format.Pptx) + + print "Removed slide by Index, please check the output file." + + def remove_slide_by_id(dataDir): + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/RemoveSlides/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'Aspose.pptx') + + # Removing a slide using its slide index + pres.getSlides().removeAt(1) + + # Saving the presentation file + save_format = SaveFormat + pres.save(dataDir + "Modified.pptx", save_format.Pptx) + + print "Removed slide by ID, please check the output file." + + + + +if __name__ == '__main__': RemoveSlides() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/SizeAndLayout.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/SizeAndLayout.py index e888cbab..57980b23 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/SizeAndLayout.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/SizeAndLayout.py @@ -1,64 +1,64 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import SlideSizeType -from com.aspose.slides import PdfOptions - -class SizeAndLayout: - - def __init__(self): - - # Setting the Size and Type of a slide - self.set_size_and_type() - - # Setting the page size when generating PDF - self.set_page_size_for_pdf() - - def set_size_and_type(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - aux_pres = 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 = SaveFormat - pres.save(dataDir + "Slide_Size_Type.pptx", save_format.Pptx) - - print "Set slide size and type, please check the output file." - - def set_page_size_for_pdf(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation() - - # Set SlideSize.Type Property - slideSizeType = SlideSizeType - pres.getSlideSize().setType(slideSizeType.A4Paper) - - # Set different properties of PDF Options - opts = PdfOptions() - opts.setSufficientResolution(600) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "Export.pdf", save_format.Pdf, opts) - - print "Set page size for pdf, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import SlideSizeType +from com.aspose.slides import PdfOptions + +class SizeAndLayout: + + def __init__(self): + + # Setting the Size and Type of a slide + self.set_size_and_type() + + # Setting the page size when generating PDF + self.set_page_size_for_pdf() + + def set_size_and_type(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + aux_pres = 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 = SaveFormat + pres.save(dataDir + "Slide_Size_Type.pptx", save_format.Pptx) + + print "Set slide size and type, please check the output file." + + def set_page_size_for_pdf(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation() + + # Set SlideSize.Type Property + slideSizeType = SlideSizeType + pres.getSlideSize().setType(slideSizeType.A4Paper) + + # Set different properties of PDF Options + opts = PdfOptions() + opts.setSufficientResolution(600) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "Export.pdf", save_format.Pdf, opts) + + print "Set page size for pdf, please check the output file." + + +if __name__ == '__main__': SizeAndLayout() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Thumbnail.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Thumbnail.py index 94c833c5..f04d1c77 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Thumbnail.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Thumbnail.py @@ -1,119 +1,119 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -from javax import ImageIO -from java.io import File - -class Thumbnail: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Thumbnail/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.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 = ImageIO - - imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) - - print "Created thumbnail, please check the output file." . PHP_EOL - - - def create_thumbnail_custom_size(dataDir): - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.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 / java_values(pres.getSlideSize().getSize().getWidth())) * desired_x - scale_y = (1.0 / java_values(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 = ImageIO() - imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) - - print "Created thumbnail with custom size, please check the output file.". PHP_EOL - - def create_thumbnail_in_notes_slides_view(dataDir): - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.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 / java_values(pres.getSlideSize().getSize().getWidth())) * desired_x - scale_y = (1.0 / java_values(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 = ImageIO() - imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) - - print "Created thumbnail in notes slides view, please check the output file." . PHP_EOL - - def create_thumbnail_of_user_defined_window(dataDir): - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.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 = ImageIO() - imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) - - print "Created thumbnail of user defined window, please check the output file." . PHP_EOL - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +from javax import ImageIO +from java.io import File + +class Thumbnail: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Thumbnail/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.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 = ImageIO + + imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail, please check the output file." . PHP_EOL + + + def create_thumbnail_custom_size(dataDir): + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.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 / java_values(pres.getSlideSize().getSize().getWidth())) * desired_x + scale_y = (1.0 / java_values(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 = ImageIO() + imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail with custom size, please check the output file.". PHP_EOL + + def create_thumbnail_in_notes_slides_view(dataDir): + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.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 / java_values(pres.getSlideSize().getSize().getWidth())) * desired_x + scale_y = (1.0 / java_values(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 = ImageIO() + imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail in notes slides view, please check the output file." . PHP_EOL + + def create_thumbnail_of_user_defined_window(dataDir): + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.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 = ImageIO() + imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg")) + + print "Created thumbnail of user defined window, please check the output file." . PHP_EOL + + +if __name__ == '__main__': Thumbnail() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Transitions.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Transitions.py index 19e37f66..de3f85d9 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Transitions.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/Transitions.py @@ -1,31 +1,31 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import TransitionType - -class Transitions: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Transitions/' - - # Instantiate Presentation class that represents the presentation file - pres = Presentation(dataDir + 'demo.pptx') - - transition_type = 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(1).getSlideShowTransition().setType(transition_type.Comb) - - # Saving the presentation - save_format = SaveFormat - pres.save(dataDir + "SimpleTransition.pptx", save_format.Pptx) - - print "Done with simple transition, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import TransitionType + +class Transitions: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/Transitions/' + + # Instantiate Presentation class that represents the presentation file + pres = Presentation(dataDir + 'demo.pptx') + + transition_type = 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(1).getSlideShowTransition().setType(transition_type.Comb) + + # Saving the presentation + save_format = SaveFormat + pres.save(dataDir + "SimpleTransition.pptx", save_format.Pptx) + + print "Done with simple transition, please check the output file." + + +if __name__ == '__main__': Transitions() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/AddSmartArt.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/AddSmartArt.py index 1ed427c4..80db4f8d 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/AddSmartArt.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/AddSmartArt.py @@ -1,34 +1,34 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import SmartArtLayoutType - -class AddSmartArt: - - def __init__(self): - - self.create_smartart_shape() - - def create_smartart_shape(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSmartArt/AddSmartArt/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Add Smart Art Shape - smartArtLayoutType=SmartArtLayoutType - smart = slide.getShapes().addSmartArt(0, 0, 400, 400, smartArtLayoutType.BasicBlockList) - - # Write the presentation as a PPTX file - saveFormat=SaveFormat - pres.save(dataDir + "SimpleSmartArt.pptx", saveFormat.Pptx) - - print "Created smartart shape, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import SmartArtLayoutType + +class AddSmartArt: + + def __init__(self): + + self.create_smartart_shape() + + def create_smartart_shape(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSmartArt/AddSmartArt/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Add Smart Art Shape + smartArtLayoutType=SmartArtLayoutType + smart = slide.getShapes().addSmartArt(0, 0, 400, 400, smartArtLayoutType.BasicBlockList) + + # Write the presentation as a PPTX file + saveFormat=SaveFormat + pres.save(dataDir + "SimpleSmartArt.pptx", saveFormat.Pptx) + + print "Created smartart shape, please check the output file." + + +if __name__ == '__main__': AddSmartArt() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/FillFormat.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/FillFormat.py index b7b67f99..0a5adb06 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/FillFormat.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSmartArt/FillFormat.py @@ -1,46 +1,46 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import SmartArtLayoutType -from com.aspose.slides import FillType - -from java.awt import Color - -class FillFormat: - - def __init__(self): - - self.create_smartart_shape() - - def create_smartart_shape(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithSmartArt/FillFormat/' - - # Create an instance of Presentation class - pres =Presentation() - - # Get the first slide - slide = pres.getSlides().get_Item(0) - - # Adding SmartArt shape and nodes - smartArtLayoutType=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=Color - fillType=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=SaveFormat - pres.save(dataDir + "FillFormat.pptx", saveFormat.Pptx) - - print "Set fill format for smartart node, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import SmartArtLayoutType +from com.aspose.slides import FillType + +from java.awt import Color + +class FillFormat: + + def __init__(self): + + self.create_smartart_shape() + + def create_smartart_shape(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithSmartArt/FillFormat/' + + # Create an instance of Presentation class + pres =Presentation() + + # Get the first slide + slide = pres.getSlides().get_Item(0) + + # Adding SmartArt shape and nodes + smartArtLayoutType=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=Color + fillType=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=SaveFormat + pres.save(dataDir + "FillFormat.pptx", saveFormat.Pptx) + + print "Set fill format for smartart node, please check the output file." + + +if __name__ == '__main__': FillFormat() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AddImage.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AddImage.py index 2c5394a3..4e84078d 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AddImage.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AddImage.py @@ -1,49 +1,49 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import TextAnchorType -from com.aspose.slides import FillType -from com.aspose.slides import TextVerticalType - -from javax import ImageIO - -from java.awt import Color - -class AddImage: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithTables/AddImage/' - - pres = 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(dataDir + "AddImage.pptx", save_format.Pptx) - - print "Added image, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import TextAnchorType +from com.aspose.slides import FillType +from com.aspose.slides import TextVerticalType + +from javax import ImageIO + +from java.awt import Color + +class AddImage: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithTables/AddImage/' + + pres = 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(dataDir + "AddImage.pptx", save_format.Pptx) + + print "Added image, please check the output file." + + +if __name__ == '__main__': AddImage() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AlignText.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AlignText.py index 8056fa93..d0638b9f 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AlignText.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithTables/AlignText.py @@ -1,66 +1,66 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import TextAnchorType -from com.aspose.slides import FillType -from com.aspose.slides import TextVerticalType - -from Javax.imageio import ImageIO - -from java.awt import Color - -class AlignText: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithTables/AlignText/' - - pres = 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 = SaveFormat() - pres.save(dataDir + "AlignText.pptx", save_format.Pptx) - - print "Aligned Text, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import TextAnchorType +from com.aspose.slides import FillType +from com.aspose.slides import TextVerticalType + +from Javax.imageio import ImageIO + +from java.awt import Color + +class AlignText: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithTables/AlignText/' + + pres = 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 = SaveFormat() + pres.save(dataDir + "AlignText.pptx", save_format.Pptx) + + print "Aligned Text, please check the output file." + + +if __name__ == '__main__': AlignText() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/CreateTextBox.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/CreateTextBox.py index b0cb4172..30642046 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/CreateTextBox.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/CreateTextBox.py @@ -1,88 +1,88 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType - - -class CreateTextBox: - - def __init__(self): - - # Creating a TextBox on Slide - self.create_textbox() - - # Creating a TextBox with Hyperlink - self.create_textbox_with_hyperlink() - - def create_textbox(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/CreateTextBox/' - - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType=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 = SaveFormat - pres.save(dataDir + "TextBox.pptx", save_format.Pptx) - - print "Created TextBox, please check the output file." - - def create_textbox_with_hyperlink(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/CreateTextBox/' - - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add autoshape of rectangle type - shapeType=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 =SaveFormat - pres.save(dataDir + "hLinkPPTX.pptx", save_format.Pptx) - - print "Created TextBox with Hyperlink, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType + + +class CreateTextBox: + + def __init__(self): + + # Creating a TextBox on Slide + self.create_textbox() + + # Creating a TextBox with Hyperlink + self.create_textbox_with_hyperlink() + + def create_textbox(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/CreateTextBox/' + + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType=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 = SaveFormat + pres.save(dataDir + "TextBox.pptx", save_format.Pptx) + + print "Created TextBox, please check the output file." + + def create_textbox_with_hyperlink(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/CreateTextBox/' + + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add autoshape of rectangle type + shapeType=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 =SaveFormat + pres.save(dataDir + "hLinkPPTX.pptx", save_format.Pptx) + + print "Created TextBox with Hyperlink, please check the output file." + + +if __name__ == '__main__': CreateTextBox() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ManageText.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ManageText.py index db67ac45..44c035c7 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ManageText.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ManageText.py @@ -1,151 +1,151 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import TextAutofitType -from com.aspose.slides import TextAnchorType -from com.aspose.slides import TextVerticalType -from java.awt import Color - -class ManageText: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' - - # 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 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=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 = SaveFormat - pres.save(dataDir + "formatText.pptx", save_format.Pptx) - - print "Set autofittype of text, please check the output file." - - def set_anchor_of_text(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' - - # 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 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=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 = SaveFormat - pres.save(dataDir + "AnchorText.pptx", save_format.Pptx) - - print "Set anchor of text, please check the output file." - - def rotate_text(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' - # 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 = SaveFormat - pres.save(dataDir + "VerticleText.pptx", save_format.Pptx) - - print "Done with text rotation, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import TextAutofitType +from com.aspose.slides import TextAnchorType +from com.aspose.slides import TextVerticalType +from java.awt import Color + +class ManageText: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' + + # 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 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=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 = SaveFormat + pres.save(dataDir + "formatText.pptx", save_format.Pptx) + + print "Set autofittype of text, please check the output file." + + def set_anchor_of_text(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' + + # 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 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=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 = SaveFormat + pres.save(dataDir + "AnchorText.pptx", save_format.Pptx) + + print "Set anchor of text, please check the output file." + + def rotate_text(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/ManageText/' + # 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 = SaveFormat + pres.save(dataDir + "VerticleText.pptx", save_format.Pptx) + + print "Done with text rotation, please check the output file." + + +if __name__ == '__main__': ManageText() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ReplaceText.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ReplaceText.py index 89c41d36..a310652f 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ReplaceText.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ReplaceText.py @@ -1,29 +1,29 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat - -class ReplaceText: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithText/ReplaceText/' - - # Create an instance of Presentation class - pres = Presentation(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 = SaveFormat - pres.save(dataDir + "Welcome_PH.pptx", save_format.Pptx) - - print "Replaced text, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat + +class ReplaceText: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithText/ReplaceText/' + + # Create an instance of Presentation class + pres = Presentation(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 = SaveFormat + pres.save(dataDir + "Welcome_PH.pptx", save_format.Pptx) + + print "Replaced text, please check the output file." + + +if __name__ == '__main__': ReplaceText() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ShadowEffects.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ShadowEffects.py index 6f9997f5..53f4b012 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ShadowEffects.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/ShadowEffects.py @@ -1,57 +1,57 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import RectangleAlignment -from java.awt import Color - - - - -class ShadowEffects: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithText/ShadowEffects/' - - # 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 - 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=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=Color - - shadow.setRectangleAlign(rectangleAlignment.TopLeft) - shadow.getShadowColor().setColor(color.black) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "OutShadow.pptx", save_format.Pptx) - - print "Applied shadow effects on text, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import RectangleAlignment +from java.awt import Color + + + + +class ShadowEffects: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithText/ShadowEffects/' + + # 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 + 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=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=Color + + shadow.setRectangleAlign(rectangleAlignment.TopLeft) + shadow.getShadowColor().setColor(color.black) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "OutShadow.pptx", save_format.Pptx) + + print "Applied shadow effects on text, please check the output file." + + +if __name__ == '__main__': ShadowEffects() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/TextFont.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/TextFont.py index b3af2619..fa69890c 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/TextFont.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/TextFont.py @@ -1,156 +1,156 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import FontData -from com.aspose.slides import NullableBool -from com.aspose.slides import TextUnderlineType -from com.aspose.slides import LoadFormat -from com.aspose.slides import LoadOptions - - -from java.awt import Color - - -class TextFont: - - def __init__(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(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' - # Create an instance of Presentation class - pres = Presentation(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 = FontData("Elephant") - fd2 = FontData("Castellar") - - # Assign fonts to portion - port1.getPortionFormat().setLatinFont(fd1) - port2.getPortionFormat().setLatinFont(fd2) - - # Set font to Bold - nullableBool=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=FillType - color=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 = SaveFormat - pres.save(dataDir + "WelcomeFont.pptx", save_format.Pptx) - - print "Done with font properties, please check the output file." - - def font_family_of_text(dataDir): - - dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' - # Create an instance of Presentation class - pres = Presentation() - - # Get the first slide - sld = pres.getSlides().get_Item(0) - - # Add an AutoShape of Rectangle type - shapeType=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=Color - port.getPortionFormat().getFillFormat().setFillType(fillType.Solid) - port.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(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(dataDir + 'input.pptx') - - # Generate PDF - save_format = SaveFormat - pres.save(dataDir + "output.pdf", save_format.Pdf) - - print "Done with font family for text, please check the output file." - - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import FontData +from com.aspose.slides import NullableBool +from com.aspose.slides import TextUnderlineType +from com.aspose.slides import LoadFormat +from com.aspose.slides import LoadOptions + + +from java.awt import Color + + +class TextFont: + + def __init__(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(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' + # Create an instance of Presentation class + pres = Presentation(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 = FontData("Elephant") + fd2 = FontData("Castellar") + + # Assign fonts to portion + port1.getPortionFormat().setLatinFont(fd1) + port2.getPortionFormat().setLatinFont(fd2) + + # Set font to Bold + nullableBool=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=FillType + color=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 = SaveFormat + pres.save(dataDir + "WelcomeFont.pptx", save_format.Pptx) + + print "Done with font properties, please check the output file." + + def font_family_of_text(dataDir): + + dataDir = Settings.dataDir + 'WorkingWithText/TextFont/' + # Create an instance of Presentation class + pres = Presentation() + + # Get the first slide + sld = pres.getSlides().get_Item(0) + + # Add an AutoShape of Rectangle type + shapeType=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=Color + port.getPortionFormat().getFillFormat().setFillType(fillType.Solid) + port.getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLUE) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(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(dataDir + 'input.pptx') + + # Generate PDF + save_format = SaveFormat + pres.save(dataDir + "output.pdf", save_format.Pdf) + + print "Done with font family for text, please check the output file." + + + +if __name__ == '__main__': TextFont() \ No newline at end of file diff --git a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/WordArt.py b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/WordArt.py index 6d56a4c5..68b82ed6 100644 --- a/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/WordArt.py +++ b/Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithText/WordArt.py @@ -1,62 +1,62 @@ -from asposeslides import Settings -from com.aspose.slides import Presentation -from com.aspose.slides import SaveFormat -from com.aspose.slides import ShapeType -from com.aspose.slides import FillType -from com.aspose.slides import RectangleAlignment -from com.aspose.slides import ColorType -from com.aspose.slides import SchemeColor - -from java.awt import Color - -class WordArt: - - def __init__(self): - - dataDir = Settings.dataDir + 'WorkingWithText/WordArt/' - - # 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 - fillType=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=ColorType - ef.getInnerShadowEffect().getShadowColor().setColorType(colorType.Scheme) - - # Set Scheme Color - schemeColor=SchemeColor - ef.getInnerShadowEffect().getShadowColor().setSchemeColor(schemeColor.Accent1) - - # Write the presentation as a PPTX file - save_format = SaveFormat - pres.save(dataDir + "WordArt.pptx", save_format.Pptx) - - print "Done with word art, please check the output file." - - -if __name__ == '__main__': +from asposeslides import Settings +from com.aspose.slides import Presentation +from com.aspose.slides import SaveFormat +from com.aspose.slides import ShapeType +from com.aspose.slides import FillType +from com.aspose.slides import RectangleAlignment +from com.aspose.slides import ColorType +from com.aspose.slides import SchemeColor + +from java.awt import Color + +class WordArt: + + def __init__(self): + + dataDir = Settings.dataDir + 'WorkingWithText/WordArt/' + + # 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 + fillType=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=ColorType + ef.getInnerShadowEffect().getShadowColor().setColorType(colorType.Scheme) + + # Set Scheme Color + schemeColor=SchemeColor + ef.getInnerShadowEffect().getShadowColor().setSchemeColor(schemeColor.Accent1) + + # Write the presentation as a PPTX file + save_format = SaveFormat + pres.save(dataDir + "WordArt.pptx", save_format.Pptx) + + print "Done with word art, please check the output file." + + +if __name__ == '__main__': WordArt() \ No newline at end of file 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..07cfa81e --- /dev/null +++ b/Plugins/Aspose-Slides-Java-for-Python/README.md @@ -0,0 +1,14 @@ +## 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://maven.aspose.com/repository/simple/ext-release-local/com/aspose/aspose-slides/) +* Place downloaded jar file into "lib" directory. + +## Documentation + +For most complete documentation of the project, check [Aspose.Slides Java For Python confluence wiki](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+for+Python). + + 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..f8262bcf --- /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..2eb020cc --- /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..3c42f31a --- /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..29f3c994 --- /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..4ea2ab8e --- /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..982d4dab --- /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..1b441596 --- /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..95f7f5ba --- /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/Examples/src/main/resources/com/aspose/slides/examples/Charts/existingchart/AsposeChart.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChart.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Charts/existingchart/AsposeChart.pptx rename to Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithCharts/ExistingChart/data/AsposeChart.pptx 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..cfac1c9c --- /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..8448c0e7 --- /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..4b7c3f4e --- /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..46a220fe --- /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..15678e07 --- /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..cebcc26b --- /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..6ec3810b --- /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..ac2bdba0 --- /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..9320aa5c --- /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..3a2e52c0 --- /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..c8c461aa --- /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..1368e495 --- /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..d14ee6fa --- /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..2858dd70 --- /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..b1aab410 --- /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..5c1316dd --- /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..ecb0671f --- /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..a18a935c --- /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..a18a935c --- /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..a5f3e17b --- /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..1e3b569f --- /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..e1f60d8f --- /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..950cb32d --- /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..e0919d68 --- /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..1f74b452 --- /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..5682ed0a --- /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..46c0c71b --- /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..0510706b --- /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..c7d34fa3 --- /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/Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/exportparagraphtext/input.pptx b/Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/input.pptx similarity index 100% rename from Examples/src/main/resources/com/aspose/slides/examples/Text/HTMLText/exportparagraphtext/input.pptx rename to Plugins/Aspose-Slides-Java-for-Python/tests/WorkingWithText/TextFont/data/input.pptx 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 diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/LICENSE b/Plugins/Aspose.Slides Java (Maven) for NetBeans/LICENSE new file mode 100644 index 00000000..a041d8f4 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2001-2016 Aspose Pty Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/README.md b/Plugins/Aspose.Slides Java (Maven) for NetBeans/README.md new file mode 100644 index 00000000..19756cb8 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/README.md @@ -0,0 +1,44 @@ +## Aspose.Slides Java (Maven) for NetBeans + +This project is **NetBeans IDE plugin** which lets developers use [Aspose.Slides for Java](https://products.aspose.com/slides/java) in their Maven based Java projects. + +## Who is supposed to use this **Plugin?** + +This plugin is intended for developers using Maven platform for Java developments and want to use [Aspose.Slides for Java](https://products.aspose.com/slides/java) in their projects. + +**NOTE:** [Aspose.Slides for Java](https://products.aspose.com/slides/java) is Java API developed by [Aspose](http://aspose.com) that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. For the API detailed features list check the [link](https://products.aspose.com/slides/java). + +## **Features** + +The plugin provides following features to work with [Aspose.Slides for Java](https://products.aspose.com/slides/java) API within **NetBeans IDE** comfortably: + +### Aspose.Slides Maven Project (wizard) + + +* By using this wizard plugin creates Maven project for using [Aspose.Slides for Java](https://products.aspose.com/slides/java) from **New Project -> Maven-> Aspose.Slides Maven Project** +* The wizard will also give option for downloading latest available Code Examples for using the API. + +### Aspose.Slides Code Example (wizard) + +* By using this wizard plugin lets you copy the downloaded Code Examples into your project for using [Aspose.Slides for Java](https://products.aspose.com/slides/java) from **New File -> Java -> Aspose.Slides Code Example** +* The wizard will also look for and updates for newly available Code Examples from [Aspose.Slides for Java examples repository.](https://github.com/aspose-slides/Aspose.Slides-for-Java/tree/master/Examples) + **NOTE:** Selected Code Examples (category) source codes will be copied under **"com.aspose.slides.examples"** package. Resources needed for running examples will be copied to the corresponding directory (package) within **"src/main/resources"**. + +### Other Features + +* Supports latest **NetBeans 8.1** version +* Compatible with **Mac**, **Linux Flavors** and **Windows** +* Native IDE user experience +* Open Source + +## What is Aspose.Slides Java API? + +**Aspose.Slides for Java** is a unique PowerPoint management component that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. + +**Aspose.Slides for Java** is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. As with all Aspose Java components, Aspose.Slides for Java is written in pure Java, incredibly priced and lightning fast. + +For more info about the **Aspose.Slides for Java API**, [please check the api documentation - click here](https://apireference.aspose.com/java/slides) + +## Plugin Documentation + +For the most complete documentation, [Please check Aspose Docs](https://docs.aspose.com/display/slidesjava/Aspose.Slides+Java+for+NetBeans+-+Maven) diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/Release Notes.html b/Plugins/Aspose.Slides Java (Maven) for NetBeans/Release Notes.html new file mode 100644 index 00000000..b2dde789 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/Release Notes.html @@ -0,0 +1,17 @@ + + + +This is new Plugin for NetBeans IDE by Aspose. This plugin is intended for developers using Maven platform for Java developments and want to use Aspose.Slides for Java in their projects.
+NOTE: Aspose.Slides for Java is Java API developed by Aspose that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint. For the API detailed features list check the link. +
The plugin provides following features to work with Aspose.Slides for Java API within NetBeans IDE comfortably: +
Aspose.Slides for Java is a unique PowerPoint management component that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint.
Aspose.Slides for Java is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. As with all Aspose Java components, Aspose.Slides for Java is written in pure Java, incredibly priced and lightning fast.
Aspose.Slides Maven Project wizard fetch and configures the latest Maven dependency reference of Aspose.Slides for Java from the Aspose Cloud Maven Repository.
The wizard also gives you option to download the Code Examples to use Aspose.Slides for Java API.
Once you are finished with this wizard - created Maven project and downloaded Code Examples. Next you can insert those Code Examples to use Aspose.Slides for Java API in your Project from New File -> Java -> Aspose.Slides Code Example
The newly created project and the Code Examples you added is now ready to be enhanced, all required resources and references are also automatically added.
+ + diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/Bundle.properties b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/Bundle.properties new file mode 100644 index 00000000..54031c34 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/Bundle.properties @@ -0,0 +1,43 @@ +OpenIDE-Module-Name=Aspose.Slides Java (Maven) for NetBeans +LBL_CreateProjectStep=Name and Location +OpenIDE-Module-Display-Category=Base IDE +OpenIDE-Module-Long-Description=\ + Aspose.Slides Maven Project wizard creates Maven Project for using Aspose.Slides for Java API within NetBeans IDE.\ +Aspose.Slides for Java is a unique PowerPoint management component that enables Java applications to read, write and manipulate PowerPoint documents (PPT, PPTX, POS, PPS, POTX, PPSX) PDF, HTML and image file formats without using Microsoft PowerPoint.\ +
Aspose.Slides for Java is the first and only Java component that provides functionality to manage PowerPoint documents within your own applications. \ + As with all Aspose Java components, Aspose.Slides for Java is written in pure Java, incredibly priced and lightning fast.\ +
Aspose.Slides Maven Project wizard fetch and configures the latest Maven dependency reference of Aspose.Slides for Java from the Aspose Cloud Maven Repository.\ +
The wizard also gives you option to download the Code Examples to use Aspose.Slides for Java API.\ +
Once you are finished with this wizard - created Maven project and downloaded Code Examples. \ + Next you can insert those Code Examples to use Aspose.Slides for Java API in your Project from New File -> Java -> Aspose.Slides Code Example
The newly created project and the Code Examples you added is now ready to be enhanced, all required resources and references are also automatically added.\ +
+OpenIDE-Module-Name=Aspose.Slides Java (Maven) for NetBeans +AsposeMavenPanel.createdFolderLabel.text=Project &Folder: +OpenIDE-Module-Short-Description=This plugins helps you to create Aspose.Slides Maven based project and tryout samples provided by Aspose. +AsposeMavenPanel.jLabelCommonUses.toolTipText= +AsposeMavenBasicPanelVisual.projectLocationLabel.text=Project &Location: +AsposeMavenBasicPanelVisual.browseButton.actionCommand=BROWSE +AsposeMavenBasicPanelVisual.browseButton.text=Br&owse... +AsposeMavenBasicPanelVisual.createdFolderLabel.text=Project &Folder: +AsposeMavenBasicPanelVisual.projectNameLabel.text=Project &Name: +AsposeMavenBasicPanelVisual.lblArtifactId.text=Artifact Id: +AsposeMavenBasicPanelVisual.lblGroupId.text=Group Id: +AsposeMavenBasicPanelVisual.lblVersion.text=Version: +AsposeMavenBasicPanelVisual.txtVersion.text= +AsposeMavenBasicPanelVisual.txtGroupId.AccessibleContext.accessibleName= +AsposeMavenBasicPanelVisual.txtVersion.AccessibleContext.accessibleName= +AsposeMavenBasicPanelVisual.lblPackage.text=Package: +AsposeMavenBasicPanelVisual.txtPackage.AccessibleContext.accessibleName= +AsposeMavenBasicPanelVisual.lblPackage1.text=(Optional) +AsposeMavenBasicPanelVisual.lblArtifactId.toolTipText= +AsposeManager.progressMessage=Retrieving Aspose.Slides for java - Maven Dependency... +AsposeManager.projectMessage=Creating Aspose.Slides maven project... +AsposeManager.progressTitle=Retrieving Latest Maven artifact... +AsposeManager.progressExamplesTitle=Downloading Code Examples... +AsposeManager.downloadExamplesMessage=Downloading Aspose.Slides for java - Example Source Codes... +AsposeMavenBasicPanelVisual.toolTipText=Aspose.Slides for Java API - Helps to create and manipulate Microsoft slides documents. +AsposeMavenBasicPanelVisual.text= +AsposeMavenBasicPanelVisual.jCheckBox1.label=Also Download Code Examples (for using Aspose.Slides for Java) +AsposeMavenBasicPanelVisual.jLabel2.text=Please enter project detail: +AsposeMavenBasicPanelVisual.jLabel3.text=Please enter maven artifact detail: +AsposeMavenBasicPanelVisual.jLabel3.toolTipText= diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/MavenSettings.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/MavenSettings.java new file mode 100644 index 00000000..16008c63 --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/MavenSettings.java @@ -0,0 +1,74 @@ +package com.aspose.slides.maven; + +import java.util.prefs.Preferences; +import org.openide.util.NbPreferences; + +/** + * + * @author Adeel + */ +public final class MavenSettings { + + private static final String PROP_LAST_ARCHETYPE_GROUPID = "lastArchetypeGroupId"; + private static final String PROP_LAST_ARCHETYPE_VERSION = "lastArchetypeVersion"; + + private Preferences getPreferences() { + return NbPreferences.forModule(MavenSettings.class); + } + + /** + * + * @return + */ + public String getLastArchetypeGroupId() { + return getPreferences().get(PROP_LAST_ARCHETYPE_GROUPID, "com.mycompany"); + } + + /** + * + * @return + */ + public String getLastArchetypeVersion() { + return getPreferences().get(PROP_LAST_ARCHETYPE_VERSION, "1.0-SNAPSHOT"); + } + + /** + * + * @param version + */ + public void setLastArchetypeVersion(String version) { + putProperty(PROP_LAST_ARCHETYPE_VERSION, version); + } + + /** + * + * @param groupId + */ + public void setLastArchetypeGroupId(String groupId) { + putProperty(PROP_LAST_ARCHETYPE_GROUPID, groupId); + } + + private String putProperty(String key, String value) { + String retval = getProperty(key); + if (value != null) { + getPreferences().put(key, value); + } else { + getPreferences().remove(key); + } + return retval; + } + private static final MavenSettings INSTANCE = new MavenSettings(); + + /** + * + * @return + */ + public static MavenSettings getDefault() { + return INSTANCE; + } + + private String getProperty(String key) { + return getPreferences().get(key, null); + } + +} diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/Metadata.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/Metadata.java new file mode 100644 index 00000000..28f2ae3b --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/Metadata.java @@ -0,0 +1,362 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2014.09.26 at 03:01:37 PM PKT +// +package com.aspose.slides.maven.artifacts; + +import javax.xml.bind.annotation.*; +import java.util.ArrayList; +import java.util.List; + +/** + *+ * Java class for anonymous complex type. + *
+ *+ * The following schema fragment specifies the expected content contained within + * this class. + *
+ * < + * pre> + * <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <element + * name="groupId" type="{http://www.w3.org/2001/XMLSchema}string"/> <element + * name="artifactId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="versioning"> <complexType> <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> <element name="latest" + * type="{http://www.w3.org/2001/XMLSchema}string"/> <element name="release" + * type="{http://www.w3.org/2001/XMLSchema}string"/> <element + * name="versions"> <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <element + * name="version" type="{http://www.w3.org/2001/XMLSchema}string" + * maxOccurs="unbounded" minOccurs="0"/> </sequence> </restriction> + * </complexContent> </complexType> </element> <element + * name="lastUpdated" type="{http://www.w3.org/2001/XMLSchema}long"/> + * </sequence> </restriction> </complexContent> </complexType> + * </element> </sequence> </restriction> </complexContent> + * </complexType> + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "groupId", + "artifactId", + "version", + "versioning", + "classifier" +}) +@XmlRootElement(name = "metadata") +public class Metadata { + + /** + * + */ + @XmlElement(required = true) + protected String groupId; + + /** + * + */ + @XmlElement(required = true) + protected String artifactId; + + /** + * + */ + @XmlElement(required = true) + protected String version; + + /** + * + */ + @XmlElement(required = true) + protected Metadata.Versioning versioning; + + /** + * + */ + protected String classifier; + + /** + * Gets the value of the groupId property. + * + * @return possible object is {@link String } + */ + public String getGroupId() { + return groupId; + } + + /** + * Sets the value of the groupId property. + * + * @param value allowed object is {@link String } + */ + public void setGroupId(String value) { + this.groupId = value; + } + + /** + * Gets the value of the artifactId property. + * + * @return possible object is {@link String } + */ + public String getArtifactId() { + return artifactId; + } + + /** + * Sets the value of the artifactId property. + * + * @param value allowed object is {@link String } + */ + public void setArtifactId(String value) { + this.artifactId = value; + } + + /** + * Gets the value of the version property. + * + * @return possible object is {@link String } + */ + public String getVersion() { + return version; + } + + /** + * Sets the value of the version property. + * + * @param value allowed object is {@link String } + */ + public void setVersion(String value) { + this.version = value; + } + + /** + * Gets the value of the versioning property. + * + * @return possible object is {@link Metadata.Versioning } + */ + public Metadata.Versioning getVersioning() { + return versioning; + } + + /** + * Sets the value of the versioning property. + * + * @param value allowed object is {@link Metadata.Versioning } + */ + public void setVersioning(Metadata.Versioning value) { + this.versioning = value; + } + + /** + *+ * Java class for anonymous complex type. + *
+ *+ * The following schema fragment specifies the expected content contained + * within this class. + *
+ * < + * pre> + * <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> + * <element name="latest" + * type="{http://www.w3.org/2001/XMLSchema}string"/> <element + * name="release" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="versions"> <complexType> <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> <element name="version" + * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" + * minOccurs="0"/> </sequence> </restriction> </complexContent> + * </complexType> </element> <element name="lastUpdated" + * type="{http://www.w3.org/2001/XMLSchema}long"/> </sequence> + * </restriction> </complexContent> </complexType> + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "latest", + "release", + "versions", + "lastUpdated" + }) + public static class Versioning { + + /** + * + */ + @XmlElement(required = true) + protected String latest; + + /** + * + */ + @XmlElement(required = true) + protected String release; + + /** + * + */ + @XmlElement(required = true) + protected Metadata.Versioning.Versions versions; + + /** + * + */ + protected long lastUpdated; + + /** + * Gets the value of the latest property. + * + * @return possible object is {@link String } + */ + public String getLatest() { + return latest; + } + + /** + * Sets the value of the latest property. + * + * @param value allowed object is {@link String } + */ + public void setLatest(String value) { + this.latest = value; + } + + /** + * Gets the value of the release property. + * + * @return possible object is {@link String } + */ + public String getRelease() { + return release; + } + + /** + * Sets the value of the release property. + * + * @param value allowed object is {@link String } + */ + public void setRelease(String value) { + this.release = value; + } + + /** + * Gets the value of the versions property. + * + * @return possible object is {@link Metadata.Versioning.Versions } + */ + public Metadata.Versioning.Versions getVersions() { + return versions; + } + + /** + * Sets the value of the versions property. + * + * @param value allowed object is {@link Metadata.Versioning.Versions } + */ + public void setVersions(Metadata.Versioning.Versions value) { + this.versions = value; + } + + /** + * Gets the value of the lastUpdated property. + * @return + */ + public long getLastUpdated() { + return lastUpdated; + } + + /** + * Sets the value of the lastUpdated property. + * @param value + */ + public void setLastUpdated(long value) { + this.lastUpdated = value; + } + + /** + *+ * Java class for anonymous complex type. + *
+ *+ * The following schema fragment specifies the expected content + * contained within this class. + *
+ * < + * pre> + * <complexType> <complexContent> <restriction + * base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> + * <element name="version" + * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" + * minOccurs="0"/> </sequence> </restriction> </complexContent> + * </complexType> + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "version" + }) + public static class Versions { + + /** + * + */ + protected Listset method for the version property.
+ *
+ *
+ * For example, to add a new item, do as follows:
+ * + * getVersion().add(newItem); + *+ * + * + * + * Objects of the following type(s) are allowed in the list + * {@link String } + * @return + */ + public List
+ * An ObjectFactory allows you to programatically construct new instances of the
+ * Java representation for XML content. The Java representation of XML content
+ * can consist of schema derived interfaces and classes representing the binding
+ * of schema type definitions, element declarations and model groups. Factory
+ * methods for each of these are provided in this class.
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of
+ * schema derived classes for package: com.aspose.maven.apis.artifacts
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link Metadata.Versioning.Versions }
+ * @return
+ */
+ public Metadata.Versioning.Versions createMetadataVersioningVersions() {
+ return new Metadata.Versioning.Versions();
+ }
+
+ /**
+ * Create an instance of {@link Metadata }
+ * @return
+ */
+ public Metadata createMetadata() {
+ return new Metadata();
+ }
+
+ /**
+ * Create an instance of {@link Metadata.Versioning }
+ * @return
+ */
+ public Metadata.Versioning createMetadataVersioning() {
+ return new Metadata.Versioning();
+ }
+
+}
diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/maven-metada.xml b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/maven-metada.xml
new file mode 100644
index 00000000..b0cfdb9c
--- /dev/null
+++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/artifacts/maven-metada.xml
@@ -0,0 +1,17 @@
+
+
Code Examples demonstrate Aspose.Slides for Java API uses. New Code Examples are coming out all the time!
Available Code Examples are displayed in tree format from where you can select categorically.
Selected Code Examples are added to the selected project along with their sources and required data files.
Newly added Code Examples are ready to be enhanced, all references are automatically added.
+ + diff --git a/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizardIterator.java b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizardIterator.java new file mode 100644 index 00000000..61117f1f --- /dev/null +++ b/Plugins/Aspose.Slides Java (Maven) for NetBeans/src/com/aspose/slides/maven/examples/AsposeExampleWizardIterator.java @@ -0,0 +1,184 @@ +/* + * 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. + */ +package com.aspose.slides.maven.examples; + +import java.awt.Component; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; +import javax.swing.JComponent; +import javax.swing.event.ChangeListener; +import org.netbeans.api.templates.TemplateRegistration; +import org.openide.WizardDescriptor; +import org.openide.util.NbBundle.Messages; + +/** + * @author Adeel Ilyas + */ +@TemplateRegistration( + folder = "Classes", + displayName = "#AsposeNewFileWizardIterator_displayName", + iconBase = "com/aspose/slides/maven/Aspose.png", + position = 10, + description = "AsposeExampleWizard.html") +@Messages("AsposeNewFileWizardIterator_displayName=Aspose.Slides Code Example") +public final class AsposeExampleWizardIterator implements WizardDescriptor.InstantiatingIterator