Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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."
Binary file not shown.
22 changes: 22 additions & 0 deletions Plugins/Aspose-Slides-Java-for-Python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Aspose.Slides Java for Python

Aspose.Slides Java for Python is a project that demonstrates / provides the Aspose.Slides for Java API usage examples in Python.

## Download

* To download Aspose.Slides for Java API to be used with these examples, Please navigate to [Aspose.Slides for Java](http://www.aspose.com/community/files/72/java-components/aspose.slides-for-java/)
* Place downloaded jar file into "lib" directory.

## Documentation

For most complete documentation of the project, check [Aspose.Slides Java For Python confluence wiki](http://www.aspose.com/docs/display/slidesjava/Aspose.Slides+Java+for+Python).

## Download Latest Versions?

* [Latest Releases on Codeplex](http://asposeslidesjavapython.codeplex.com/releasesce)

## Clone Plugin SourceCodes?

This project is also hosted and maintained at CodePlex. To clone navigate to:

* [Aspose.Slides Java for Python on CodePlex - click here](https://asposeslidesjavapython.codeplex.com/SourceControl/latest)
Loading