Skip to content

Commit 57aaeeb

Browse files
Merge pull request #19 from fahadadeel/master
Initial Commit Aspose.Slides Java for Python
2 parents 60b1cdf + bba8827 commit 57aaeeb

File tree

134 files changed

+4103
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+4103
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
__author__ = 'fahadadeel'
2+
import jpype
3+
4+
class HelloWorld:
5+
6+
def __init__(self, dataDir):
7+
print "init func"
8+
self.dataDir = dataDir
9+
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
10+
self.ShapeType=jpype.JClass("com.aspose.slides.ShapeType")
11+
self.FillType=jpype.JClass("com.aspose.slides.FillType")
12+
self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat")
13+
self.Color=jpype.JPackage("java.awt.Color")
14+
15+
def main(self):
16+
17+
# Instantiate Presentation
18+
pres = self.Presentation()
19+
20+
# Get the first slide
21+
slide = pres.getSlides().get_Item(0)
22+
23+
# Add an AutoShape of Rectangle type
24+
shape_type = self.ShapeType
25+
slide_shapes = slide.getShapes()
26+
ashp = slide_shapes().addAutoShape(shape_type.Rectangle, 150, 75, 150, 50)
27+
28+
# Add ITextFrame to the Rectangle
29+
ashp.addTextFrame("Hello World")
30+
31+
# Change the text color to Black (which is White by default)
32+
fill_type = self.FillType()
33+
color = self.Color()
34+
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().setFillType(fill_type.Solid)
35+
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getFillFormat().getSolidFillColor().setColor(color.BLACK)
36+
37+
# Change the line color of the rectangle to White
38+
ashp.getShapeStyle().getLineColor().setColor(color.WHITE)
39+
40+
# Remove any fill formatting in the shape
41+
ashp.getFillFormat().setFillType(fill_type.NoFill)
42+
43+
# Save the presentation to disk
44+
save_format = self.SaveFormat
45+
pres.save(self.dataDir + "HelloWorld.pptx", save_format.Pptx)
46+
47+
print "Document has been saved, please check the output file."
Binary file not shown.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Aspose.Slides Java for Python
2+
3+
Aspose.Slides Java for Python is a project that demonstrates / provides the Aspose.Slides for Java API usage examples in Python.
4+
5+
## Download
6+
7+
* 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/)
8+
* Place downloaded jar file into "lib" directory.
9+
10+
## Documentation
11+
12+
For most complete documentation of the project, check [Aspose.Slides Java For Python confluence wiki](http://www.aspose.com/docs/display/slidesjava/Aspose.Slides+Java+for+Python).
13+
14+
## Download Latest Versions?
15+
16+
* [Latest Releases on Codeplex](http://asposeslidesjavapython.codeplex.com/releasesce)
17+
18+
## Clone Plugin SourceCodes?
19+
20+
This project is also hosted and maintained at CodePlex. To clone navigate to:
21+
22+
* [Aspose.Slides Java for Python on CodePlex - click here](https://asposeslidesjavapython.codeplex.com/SourceControl/latest)

0 commit comments

Comments
 (0)