Package com.aspose.slides

Examples of com.aspose.slides.ISlide


  {
    //Instantiate a Presentation object that represents a PPT file
    Presentation pres = new Presentation("data/presentation.ppt");
   
    //Accessing a slide using its slide position
    ISlide slide = pres.getSlides().get_Item(0);
   
    //===========================================================
    // Plain Line
    //===========================================================
    //Adding a line shape into the slide with its start and end points
    slide.getShapes().addAutoShape(ShapeType.Line, 50, 50, 400, 0);

    //===========================================================
    // Adding Simple Ellipse in the Slide
    //============================================================
    //Adding an ellipse shape into the slide by defining its X,Y postion, width and height
    slide.getShapes().addAutoShape(ShapeType.Ellipse, 270, 150, 350, 50);
      
    //============================================================
    // Adding Simple Rectangle in the Slide
    //============================================================
   
    //Adding a rectangle shape into the slide by defining its X,Y position, width and height
    slide.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 200, 100);
   
    //===========================================================
    // Arrow Shaped Line
    //============================================================
    ///Add an autoshape of type line

        IAutoShape shp = slide.getShapes().addAutoShape(ShapeType.Line, 50, 130, 300, 0);

        //Apply some formatting on the line
        shp.getLineFormat().setStyle (LineStyle.ThickBetweenThin);
        shp.getLineFormat().setWidth ( 10);

        shp.getLineFormat().setDashStyle  (LineDashStyle.DashDot);

        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(new Color(com.aspose.slides.PresetColor.Maroon));
      
    //===========================================================
    // Adding Formatted Ellipse in the Slide
    //============================================================
        //Add autoshape of ellipse type
        shp = slide.getShapes().addAutoShape(ShapeType.Ellipse, 270, 350, 350, 50);

        //Apply some formatting to ellipse shape
        shp.getFillFormat().setFillType(FillType.Solid);
        shp.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Chocolate));

        //Apply some formatting to the line of Ellipse
        shp.getLineFormat().getFillFormat().setFillType(FillType.Solid);
        shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK);
        shp.getLineFormat().setWidth(5);
   
    //============================================================
    // Adding Formatted Rectangle to Slide
    //============================================================
    //Adding a rectangle shape into the slide by defining its X,Y position, width and height
        shp = slide.getShapes().addAutoShape(ShapeType.Rectangle, 50, 350, 200, 100);

        //Apply some formatting to ellipse shape
        shp.getFillFormat().setFillType(FillType.Solid);
        shp.getFillFormat().getSolidFillColor().setColor(new Color(PresetColor.Chocolate));
View Full Code Here


  {
        //Instantiate Presentation class that represents PPTX file
        Presentation pres = new Presentation();

        //Access first slide
        ISlide sld = pres.getSlides().get_Item(0);
       
        //Define columns with widths and rows with heights
        double[] dblCols = { 50, 50, 50 };
        double[] dblRows = { 50, 30, 30, 30, 30 };
        //Add table shape to slide
        ITable tbl = sld.getShapes().addTable(100, 50, dblCols, dblRows);

        //Set border format for each cell

        for(int row = 0; row < tbl.getRows().size(); row++)
        {
View Full Code Here

  {
    //Instantiating presentation//Instantiating presentation
    Presentation pres = new Presentation();

    //Accessing the first slide
    ISlide slide = pres.getSlides().get_Item(0);

    //Adding the sample chart
    IChart chart = slide.getShapes().addChart(ChartType.LineWithMarkers, 50, 50, 500, 400);

    //Setting Chart Titile
    chart.hasTitle(true);
    chart.getChartTitle().addTextFrameForOverriding("");
    IPortion chartTitle = chart.getChartTitle().getTextFrameForOverriding().getParagraphs().get_Item(0).getPortions().get_Item(0);
View Full Code Here

  {
    //Instantiate Presentation class that represents PPTX file//Instantiate Presentation class that represents PPTX file
    Presentation pres = new Presentation("data/AsposeChart.pptx");

    //Access first slide
    ISlide sld = pres.getSlides().get_Item(0);

    // Add chart with default data
    IChart chart = (IChart)sld.getShapes().get_Item(0);

    //Setting the index of chart data sheet
    int defaultWorksheetIndex = 0;

    //Getting the chart data worksheet
View Full Code Here

    pres.getSlides().removeAt(1); //Removing a slide using its index

    //===========================================================
    //Accessing a slide using its index in the slides collection
    ISlide slide = pres.getSlides().get_Item(0);
    pres.getSlides().remove(slide); //Removing a slide using its reference

        //Writing the presentation as a PPTX file
        pres.save("data/DeleteSlides_Aspose.pptx", SaveFormat.Pptx);
View Full Code Here

  {
    //Instantiate a PresentationEx object that represents a PPTX file
    Presentation pres = new Presentation("data/presentation.pptx");
   
      //Add the title slide
      ISlide slide = pres.getSlides().addEmptySlide(pres.getLayoutSlides().get_Item(0));
   
    //Save the presentation
    pres.save("data/SlidesAdded_Aspose.pptx", SaveFormat.Pptx);
   
    System.out.println("Slide Added and Saved.");
View Full Code Here

  {
    //Instantiate a Presentation object that represents a PPT file
    Presentation pres = new Presentation("data/presentation.ppt");
       
    //Accessing a slide using its slide position
    ISlide slide = pres.getSlides().get_Item(0);
   
    //Change the position of the selected slide
    slide.setSlideNumber(2);

    //Writing the presentation as a PPT file
    pres.save("data/Aspose_ReOrdered_Slides.ppt", SaveFormat.Ppt);
    System.out.println("Slides ReOrdered Successfuly.");
  }
View Full Code Here

  {
    // Instantiate Presentation class that represents PPTX
    Presentation pres = new Presentation();

    // Access first slide
    ISlide slide = pres.getSlides().get_Item(0);

    // Add an AutoShape of Rectangle Type
    IShape pptxShape = slide.getShapes().addAutoShape(ShapeType.Rectangle,
        150, 150, 150, 50);

    // Cast the shape to AutoShape
    IAutoShape pptxAutoShape = (IAutoShape) pptxShape;
View Full Code Here

TOP

Related Classes of com.aspose.slides.ISlide

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.